java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.external.wordNet.WordNetLinker
All Implemented Interfaces:
LabelToConceptLinker

public class WordNetLinker extends Object implements LabelToConceptLinker
This class is capable of linking words to concepts in WordNet.
  • Field Details

    • LOGGER

      private static org.slf4j.Logger LOGGER
    • dictionary

      private WordNetKnowledgeSource dictionary
      The WordNet dictionary instance that is to be used.
    • nameOfLinker

      private String nameOfLinker
    • singleConceptBuffer

      private HashMap<String,String> singleConceptBuffer
      Mapping Buffer
  • Constructor Details

  • Method Details

    • linkToSingleConcept

      public String linkToSingleConcept(String labelToBeLinked)
      Description copied from interface: LabelToConceptLinker
      Queries for a concept and returns a link that represents an entity in the background knowledge source such as the SemanticWordRelationDictionary. Note that the link may not always be something intuitive such as a URI but may also be an artificial identifier that is understood by the corresponding background knowledge source.
      Specified by:
      linkToSingleConcept in interface LabelToConceptLinker
      Parameters:
      labelToBeLinked - The label which shall be linked to a single concept.
      Returns:
      Concept or null if no link could be found.
    • linkToPotentiallyMultipleConcepts

      public HashSet<String> linkToPotentiallyMultipleConcepts(String labelToBeLinked)
      Description copied from interface: LabelToConceptLinker
      This method tries to link labelToBeLinked to one concept if possible. If it fails, it will try to link it to multiple concepts.
      Specified by:
      linkToPotentiallyMultipleConcepts in interface LabelToConceptLinker
      Parameters:
      labelToBeLinked - The label which shall be linked.
      Returns:
      One or multiple linked concepts in a set. Null if it could not fully link the label.
    • linkLabelToTokensLeftToRight

      private HashSet<String> linkLabelToTokensLeftToRight(String labelToBeLinked)
      Splits the labelToBeLinked in ngrams up to infinite size and tries to link components. This corresponds to a MAXGRAM_LEFT_TO_RIGHT_TOKENIZER or NGRAM_LEFT_TO_RIGHT_TOKENIZER OneToManyLinkingStrategy.
      Parameters:
      labelToBeLinked - The label that shall be linked.
      Returns:
      A set of concept URIs that were found.
    • getNameOfLinker

      public String getNameOfLinker()
      Description copied from interface: LabelToConceptLinker
      Get instance specific name of the linker.
      Specified by:
      getNameOfLinker in interface LabelToConceptLinker
      Returns:
      Name as String.
    • setNameOfLinker

      public void setNameOfLinker(String nameOfLinker)
      Description copied from interface: LabelToConceptLinker
      Set instance specific name of the linker.
      Specified by:
      setNameOfLinker in interface LabelToConceptLinker
      Parameters:
      nameOfLinker - Name to be set.
    • normalizeForWordnetLookupWithTokenization

      public static String normalizeForWordnetLookupWithTokenization(String lookupString)
      Normalize for WordNet lookup, i.e., lowercasing and camel-case resolution. Dev-Remark: The WordNet library utilizes space-separation.
      Parameters:
      lookupString - The string that shall be normalized for lookup.
      Returns:
      Space-separated lookup word.
    • normalizeForWordnetLookupWithOutTokenization

      public static String normalizeForWordnetLookupWithOutTokenization(String lookupString)
      Normalize for WordNet lookup, i.e., lowercasing. No camelCase resolution. Dev-Remark: The WordNet library utilizes space-separation.
      Parameters:
      lookupString - The string that shall be normalized for lookup.
      Returns:
      Space-separated lookup word.