Class WordNetKnowledgeSource
java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.external.SemanticWordRelationDictionary
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.external.wordNet.WordNetKnowledgeSource
- All Implemented Interfaces:
ExternalResource
,ExternalResourceWithHypernymCapability
,ExternalResourceWithSynonymCapability
,HypernymCapability
,SynonymCapability
API for WordNet requests.
-
Field Summary
Modifier and TypeFieldDescriptionBuffer for synonymsprivate net.sf.extjwnl.dictionary.Dictionary
WordNet dictionary instance.(package private) WordNetLinker
the linker that is used to link words to wordnet conceptsprivate static org.slf4j.Logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closing open resources.getHypernyms
(String linkedConcept) Retrieves a set of hypernyms independently of the word sense.getIdGivenLink
(String link) Returns the linker instance for this particular resource.getName()
Obtain the name of the resource.getSynonyms
(String word, net.sf.extjwnl.data.POS partOfSpeech) Get synonyms for a particular part of speech.getSynonymsLexical
(String linkedConcept) Retrieve Synonyms for the given word.boolean
isInDictionary
(String word) Checks whether the given word can be found in the dictionary, regardless of POS.Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.external.SemanticWordRelationDictionary
isHypernym, isHypernym, isHypernymous, isStrongFormSynonymous, isSynonymous, isSynonymousOrHypernymous
-
Field Details
-
LOGGER
private static org.slf4j.Logger LOGGER -
dictionary
private net.sf.extjwnl.dictionary.Dictionary dictionaryWordNet dictionary instance. -
buffer
Buffer for synonyms -
linker
WordNetLinker linkerthe linker that is used to link words to wordnet concepts
-
-
Constructor Details
-
WordNetKnowledgeSource
public WordNetKnowledgeSource()Constructor
-
-
Method Details
-
isInDictionary
Checks whether the given word can be found in the dictionary, regardless of POS.- Parameters:
word
- to be found- Returns:
- true if successful, else false.
-
getSynonymsLexical
Retrieve Synonyms for the given word.- Specified by:
getSynonymsLexical
in interfaceSynonymCapability
- Specified by:
getSynonymsLexical
in classSemanticWordRelationDictionary
- Parameters:
linkedConcept
- for which synonyms shall be retrieved.- Returns:
- Synonyms
-
getSynonyms
Get synonyms for a particular part of speech.- Parameters:
word
- The word for which the synonyms shall be retrieved.partOfSpeech
- The part of speech of the word.- Returns:
- a set of synonyms.
-
getHypernyms
Description copied from class:SemanticWordRelationDictionary
Retrieves a set of hypernyms independently of the word sense. The assumed language is English.- Specified by:
getHypernyms
in classSemanticWordRelationDictionary
- Parameters:
linkedConcept
- The linked concept for which hypernyms shall be retrieved.- Returns:
- A set of linked concepts.
-
getIdGivenLink
-
close
public void close()Description copied from class:SemanticWordRelationDictionary
Closing open resources.- Specified by:
close
in classSemanticWordRelationDictionary
-
getLinker
Description copied from interface:ExternalResource
Returns the linker instance for this particular resource.- Specified by:
getLinker
in interfaceExternalResource
- Specified by:
getLinker
in classSemanticWordRelationDictionary
- Returns:
- The specific linker used to link words to concepts.
-
getName
Description copied from interface:ExternalResource
Obtain the name of the resource.- Specified by:
getName
in interfaceExternalResource
- Specified by:
getName
in classSemanticWordRelationDictionary
- Returns:
- Name of the resource.
-