Interface Synset<S extends Sense, E extends SynsetRelation, T extends SynsetRelationType, G extends Gloss, X extends Example>
- Type Parameters:
S- theSensetypeE- theSynsetRelationtype for relations between synsetsG- theGloss(i.e. definition) typeX- theExampletype
- All Known Subinterfaces:
BabelSynset
public interface Synset<S extends Sense, E extends SynsetRelation, T extends SynsetRelationType, G extends Gloss, X extends Example>
extends Iterable<S>, Taggable
A general class for a synonym set (synset).
- Author:
- navigli
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddStringTag(StringTag tag) getExamples(it.uniroma1.lcl.jlt.util.Language lang) getExamples(it.uniroma1.lcl.jlt.util.Language lang, SenseSource source) getExamples(SenseSource source) getGlosses(it.uniroma1.lcl.jlt.util.Language lang) getGlosses(it.uniroma1.lcl.jlt.util.Language lang, SenseSource source) getGlosses(SenseSource source) getID()Gets the ID of thisSynset.default Set<it.uniroma1.lcl.jlt.util.Language> Gets the set of languages used in thisSynset.getMainExample(it.uniroma1.lcl.jlt.util.Language lang) getMainGloss(it.uniroma1.lcl.jlt.util.Language lang) getOutgoingEdges(T... edgeTypes) Collects allSynsetRelationedges of theSynsetRelationTypes given as input for thisSynsetRelation.it.uniroma1.lcl.jlt.util.POSgetPOS()Gets the part of speech of thisSynset.Get the senses contained in thisSynsetgetSenses(it.uniroma1.lcl.jlt.util.Language language) Get the senses contained in thisSynsetfor an input languagegetSenses(it.uniroma1.lcl.jlt.util.Language language, SenseSource source) Get the senses contained in thisSynsetfor an input language and sense sourcegetSenses(SenseSource source) Get the senses contained in thisSynsetfor an input sense sourcegetSenses(String lemma, it.uniroma1.lcl.jlt.util.Language language, boolean normalized, SenseSource... sources) Gets theSenses for the input word in the given languagegetSenses(String lemma, it.uniroma1.lcl.jlt.util.Language language, SenseSource... sources) Gets theSenses for the input word in the given languageList<? extends SenseSource> Collects allSenseSources contained for thisSynset.getType()Gets the type of thisSynset, namely whether it's an entity, a concept, etc.booleanretainSenses(Predicate<? super S> predicate) Retains all the senses which pass the predicate testdefault booleanretainSenses(List<Predicate<? super S>> predicates) Retains all the senses which pass the predicate testsintsize()Returns the number of senses in the synsettoURIs(ExternalResource resource) Returns the URIs of the various senses in the synset for a givenExternalResourcetoURIs(ExternalResource resource, it.uniroma1.lcl.jlt.util.Language... languages) Returns the URIs of the various senses in the given languages in the synset for a givenExternalResourcetoURIs(ExternalResource resource, Collection<it.uniroma1.lcl.jlt.util.Language> languages) Returns the URIs of the various senses in the given languages in the synset for a givenExternalResourceMethods inherited from interface Iterable
forEach, iterator, spliteratorMethods inherited from interface Taggable
getTags, getTags, isTaggedAs, isTaggedAs, isTaggedAs
-
Method Details
-
getID
-
getPOS
-
getDomains
-
getLanguages
-
getSenses
-
getSenses
-
getSenses
Get the senses contained in thisSynsetfor an input sense source- Parameters:
source- the source of the senses to be retrieved- Returns:
- the senses of this synset from an input sense source.
-
getSenses
Get the senses contained in thisSynsetfor an input language and sense source- Parameters:
language- the language used to searchsource- the source of the senses to be retrieved- Returns:
- the senses of this synset from an input sense source.
-
getSenses
default List<S> getSenses(String lemma, it.uniroma1.lcl.jlt.util.Language language, SenseSource... sources) Gets theSenses for the input word in the given language- Parameters:
lemma- lemma of the senselanguage- language of the sensesources- possible sources for the sense- Returns:
- the
Senses for the input word in the given language
-
getSenses
List<S> getSenses(String lemma, it.uniroma1.lcl.jlt.util.Language language, boolean normalized, SenseSource... sources) Gets theSenses for the input word in the given language- Parameters:
lemma- lemma of the senselanguage- language of the sensenormalized- use normalization?sources- possible sources for the sense- Returns:
- the
Senses for the input word in the given language
-
retainSenses
-
retainSenses
-
getMainGloss
-
getMainGloss
-
getGlosses
-
getGlosses
-
getGlosses
-
getGlosses
-
getMainExample
-
getMainExample
-
getExamples
-
getExamples
-
getExamples
-
getExamples
-
getSenseSources
List<? extends SenseSource> getSenseSources()Collects allSenseSources contained for thisSynset.- Returns:
- a list of
SenseSources
-
getOutgoingEdges
-
getOutgoingEdges
Collects allSynsetRelationedges of theSynsetRelationTypes given as input for thisSynsetRelation.- Parameters:
edgeTypes- the types of the edges connecting this synset to other synsets- Returns:
- only the
SynsetRelations tagged with theSynsetRelationTypes given as input
-
getType
SynsetType getType()Gets the type of thisSynset, namely whether it's an entity, a concept, etc.- Returns:
- the kind of
Synset.
-
size
int size()Returns the number of senses in the synset- Returns:
- the number of senses in the synset
-
toURIs
Returns the URIs of the various senses in the synset for a givenExternalResource- Parameters:
resource- the external resource- Returns:
- the URIs to the external resource
-
toURIs
default List<String> toURIs(ExternalResource resource, it.uniroma1.lcl.jlt.util.Language... languages) Returns the URIs of the various senses in the given languages in the synset for a givenExternalResource- Parameters:
resource- the external resourcelanguages- the languages of interest- Returns:
- the URIs to the external resource
-
toURIs
default List<String> toURIs(ExternalResource resource, Collection<it.uniroma1.lcl.jlt.util.Language> languages) Returns the URIs of the various senses in the given languages in the synset for a givenExternalResource- Parameters:
resource- the external resourcelanguages- the languages of interest- Returns:
- the URIs to the external resource
-
addStringTag
-