Class SemanticWordRelationDictionary

java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.external.SemanticWordRelationDictionary
All Implemented Interfaces:
ExternalResource, ExternalResourceWithHypernymCapability, ExternalResourceWithSynonymCapability, HypernymCapability, SynonymCapability
Direct Known Subclasses:
BabelNetKnowledgeSource, DBpediaKnowledgeSource, GensimEmbeddingModel, WebIsAlodClassicKnowledgeSource, WebIsAlodXLKnowledgeSource, WikidataKnowledgeSource, WiktionaryKnowledgeSource, WordNetKnowledgeSource

public abstract class SemanticWordRelationDictionary extends Object implements ExternalResourceWithSynonymCapability, ExternalResourceWithHypernymCapability
Abstract class for dictionary access.
Author:
Jan Portisch
  • Constructor Details

    • SemanticWordRelationDictionary

      public SemanticWordRelationDictionary()
  • Method Details

    • getSynonymsLexical

      @NotNull public abstract @NotNull Set<String> getSynonymsLexical(String linkedConcept)
      Retrieves a list of synonyms independently of the word sense. The assumed language is English.
      Specified by:
      getSynonymsLexical in interface SynonymCapability
      Parameters:
      linkedConcept - The linked concept for which synonyms shall be retrieved.
      Returns:
      A set of synonyms in word form (not links).
    • getHypernyms

      public abstract Set<String> getHypernyms(String linkedConcept)
      Retrieves a set of hypernyms independently of the word sense. The assumed language is English.
      Parameters:
      linkedConcept - The linked concept for which hypernyms shall be retrieved.
      Returns:
      A set of linked concepts.
    • close

      public abstract void close()
      Closing open resources.
    • isSynonymous

      @Deprecated public boolean isSynonymous(String link1, String link2)
      Deprecated.
      Checks for synonymous words in a loose-form fashion: There has to be an overlap in the two sets of synonyms or word_1 and word_2. The assumed language is English.
      Specified by:
      isSynonymous in interface SynonymCapability
      Parameters:
      link1 - linked word 1
      link2 - linked word 2
      Returns:
      True if the given words are synonymous, else false.
    • isHypernymous

      public boolean isHypernymous(String linkedConcept_1, String linkedConcept_2)
      Checks for hypernymous words in a loose-form fashion: One concept needs to be a hypernym of the other concept where the order of concepts is irrelevant, i.e., the method returns (hypernymous(w1, w2) || hypernymous(w2, w1). The assumed language is English. CHECKS ONLY FOR LEVEL 1 HYPERNYMY - NO REASONING IS PERFORMED.
      Specified by:
      isHypernymous in interface HypernymCapability
      Parameters:
      linkedConcept_1 - linked word 1
      linkedConcept_2 - linked word 2
      Returns:
      True if the given words are hypernymous, else false.
    • isSynonymousOrHypernymous

      public boolean isSynonymousOrHypernymous(String linkedConcept_1, String linkedConcept_2)
      Checks whether the two concepts are snonymous or whether there is a hypernymy/homonymy relation between them.
      Parameters:
      linkedConcept_1 - linked concept 1.
      linkedConcept_2 - linked concept 2.
      Returns:
      True or false.
    • isStrongFormSynonymous

      public boolean isStrongFormSynonymous(String link1, String link2)
      Checks for synonymy by determining whether link1 is contained in the set of synonymous words of link2 or vice versa.
      Specified by:
      isStrongFormSynonymous in interface SynonymCapability
      Parameters:
      link1 - Word 1
      link2 - Word 2
      Returns:
      True if the given words are synonymous, else false.
    • isHypernym

      public boolean isHypernym(String superConcept, String subConcept)
      Checks for a one sided hypernymy relation (as opposed to isHypernymous(String, String).
      Specified by:
      isHypernym in interface HypernymCapability
      Parameters:
      superConcept - The linked super concept.
      subConcept - The linked sub concept.
      Returns:
      True if superConcept is a hypernym of subConcept.
    • isHypernym

      public boolean isHypernym(String superConcept, String subConcept, int depth)
      Checks for a one sided hypernymy relation (as opposed to isHypernymous(String, String).
      Parameters:
      superConcept - The linked super concept.
      subConcept - The linked sub concept.
      depth - The desired depth. Must be one or larger.
      Returns:
      True if superConcept is a hypernym of subConcept.
    • getLinker

      public abstract LabelToConceptLinker getLinker()
      Description copied from interface: ExternalResource
      Returns the linker instance for this particular resource.
      Specified by:
      getLinker in interface ExternalResource
      Returns:
      The specific linker used to link words to concepts.
    • getName

      public abstract String getName()
      Description copied from interface: ExternalResource
      Obtain the name of the resource.
      Specified by:
      getName in interface ExternalResource
      Returns:
      Name of the resource.