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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
close()
Closing open resources.getHypernyms
(String linkedConcept) Retrieves a set of hypernyms independently of the word sense.abstract LabelToConceptLinker
Returns the linker instance for this particular resource.abstract String
getName()
Obtain the name of the resource.getSynonymsLexical
(String linkedConcept) Retrieves a list of synonyms independently of the word sense.boolean
isHypernym
(String superConcept, String subConcept) Checks for a one sided hypernymy relation (as opposed toisHypernymous(String, String)
.boolean
isHypernym
(String superConcept, String subConcept, int depth) Checks for a one sided hypernymy relation (as opposed toisHypernymous(String, String)
.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).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.boolean
isSynonymous
(String link1, String link2) Deprecated.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.
-
Constructor Details
-
SemanticWordRelationDictionary
public SemanticWordRelationDictionary()
-
-
Method Details
-
getSynonymsLexical
Retrieves a list of synonyms independently of the word sense. The assumed language is English.- Specified by:
getSynonymsLexical
in interfaceSynonymCapability
- Parameters:
linkedConcept
- The linked concept for which synonyms shall be retrieved.- Returns:
- A set of synonyms in word form (not links).
-
getHypernyms
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.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 interfaceSynonymCapability
- Parameters:
link1
- linked word 1link2
- linked word 2- Returns:
- True if the given words are synonymous, else false.
-
isHypernymous
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 interfaceHypernymCapability
- Parameters:
linkedConcept_1
- linked word 1linkedConcept_2
- linked word 2- Returns:
- True if the given words are hypernymous, else false.
-
isSynonymousOrHypernymous
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
Checks for synonymy by determining whether link1 is contained in the set of synonymous words of link2 or vice versa.- Specified by:
isStrongFormSynonymous
in interfaceSynonymCapability
- Parameters:
link1
- Word 1link2
- Word 2- Returns:
- True if the given words are synonymous, else false.
-
isHypernym
Checks for a one sided hypernymy relation (as opposed toisHypernymous(String, String)
.- Specified by:
isHypernym
in interfaceHypernymCapability
- Parameters:
superConcept
- The linked super concept.subConcept
- The linked sub concept.- Returns:
- True if superConcept is a hypernym of subConcept.
-
isHypernym
Checks for a one sided hypernymy relation (as opposed toisHypernymous(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
Description copied from interface:ExternalResource
Returns the linker instance for this particular resource.- Specified by:
getLinker
in interfaceExternalResource
- 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
- Returns:
- Name of the resource.
-