Package it.uniroma1.lcl.kb
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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddStringTag(StringTag tag)HashMap<Domain,Double>getDomains()List<X>getExamples()default List<X>getExamples(it.uniroma1.lcl.jlt.util.Language lang)List<X>getExamples(it.uniroma1.lcl.jlt.util.Language lang, SenseSource source)default List<X>getExamples(SenseSource source)List<G>getGlosses()default List<G>getGlosses(it.uniroma1.lcl.jlt.util.Language lang)List<G>getGlosses(it.uniroma1.lcl.jlt.util.Language lang, SenseSource source)default List<G>getGlosses(SenseSource source)SynsetIDgetID()Gets the ID of thisSynset.default Set<it.uniroma1.lcl.jlt.util.Language>getLanguages()Gets the set of languages used in thisSynset.default Optional<X>getMainExample()Optional<X>getMainExample(it.uniroma1.lcl.jlt.util.Language lang)default Optional<G>getMainGloss()Optional<G>getMainGloss(it.uniroma1.lcl.jlt.util.Language lang)default List<E>getOutgoingEdges()List<E>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.List<S>getSenses()Get the senses contained in thisSynsetList<S>getSenses(it.uniroma1.lcl.jlt.util.Language language)Get the senses contained in thisSynsetfor an input languageList<S>getSenses(it.uniroma1.lcl.jlt.util.Language language, SenseSource source)Get the senses contained in thisSynsetfor an input language and sense sourceList<S>getSenses(SenseSource source)Get the senses contained in thisSynsetfor an input sense sourceList<S>getSenses(String lemma, it.uniroma1.lcl.jlt.util.Language language, boolean normalized, SenseSource... sources)Gets theSenses for the input word in the given languagedefault List<S>getSenses(String lemma, it.uniroma1.lcl.jlt.util.Language language, SenseSource... sources)Gets theSenses for the input word in the given languageList<? extends SenseSource>getSenseSources()Collects allSenseSources contained for thisSynset.SynsetTypegetType()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 synsetdefault List<String>toURIs(ExternalResource resource)Returns the URIs of the various senses in the synset for a givenExternalResourcedefault 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 givenExternalResourcedefault 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-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface it.uniroma1.lcl.babelnet.data.Taggable
getTags, getTags, isTaggedAs, isTaggedAs, isTaggedAs
-
-
-
-
Method Detail
-
getPOS
it.uniroma1.lcl.jlt.util.POS getPOS()
Gets the part of speech of thisSynset.- Returns:
- the part of speech of this
Synset.
-
getLanguages
default Set<it.uniroma1.lcl.jlt.util.Language> getLanguages()
Gets the set of languages used in thisSynset.- Returns:
- the set of languages used in this
Synset.
-
getSenses
List<S> getSenses()
Get the senses contained in thisSynset- Returns:
- the senses of this synset.
-
getSenses
List<S> getSenses(it.uniroma1.lcl.jlt.util.Language language)
Get the senses contained in thisSynsetfor an input language- Parameters:
language- the language used to search- Returns:
- the senses of this synset in a specific language.
-
getSenses
List<S> getSenses(SenseSource source)
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
List<S> getSenses(it.uniroma1.lcl.jlt.util.Language language, SenseSource source)
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
boolean retainSenses(Predicate<? super S> predicate)
Retains all the senses which pass the predicate test- Parameters:
predicate- the predicate used to decide whether to keep each sense in the synset- Returns:
- true if at least one sense is left in the synset, false otherwise
-
retainSenses
default boolean retainSenses(List<Predicate<? super S>> predicates)
Retains all the senses which pass the predicate tests- Parameters:
predicates- the predicates used to decide whether to keep each sense in the synset- Returns:
- true if at least one sense is left in the synset, false otherwise
-
getMainGloss
Optional<G> getMainGloss(it.uniroma1.lcl.jlt.util.Language lang)
- Parameters:
lang- the gloss language- Returns:
- the
Glossfor the input language
-
getGlosses
List<G> getGlosses(it.uniroma1.lcl.jlt.util.Language lang, SenseSource source)
- Parameters:
lang- the gloss languagesource- the gloss source- Returns:
- all glosses of this
Synsetfor the input source
-
getGlosses
default List<G> getGlosses(SenseSource source)
- Parameters:
source- the gloss source- Returns:
- all glosses of this
Synsetfor the input source
-
getGlosses
default List<G> getGlosses(it.uniroma1.lcl.jlt.util.Language lang)
- Parameters:
lang- the gloss language- Returns:
- all glosses of this
Synsetfor the input language
-
getMainExample
Optional<X> getMainExample(it.uniroma1.lcl.jlt.util.Language lang)
- Parameters:
lang- the example language- Returns:
- the main
Examplefor the input language
-
getExamples
default List<X> getExamples(it.uniroma1.lcl.jlt.util.Language lang)
- Parameters:
lang- the example language- Returns:
- all examples of this
Synsetfor the input language
-
getExamples
default List<X> getExamples(SenseSource source)
- Parameters:
source- the example source- Returns:
- all examples of this
Synsetfor the input language and source
-
getExamples
List<X> getExamples(it.uniroma1.lcl.jlt.util.Language lang, SenseSource source)
- Parameters:
lang- the example languagesource- the example source- Returns:
- all examples of this
Synsetfor the input language and source
-
getSenseSources
List<? extends SenseSource> getSenseSources()
Collects allSenseSources contained for thisSynset.- Returns:
- a list of
SenseSources
-
getOutgoingEdges
default List<E> getOutgoingEdges()
- Returns:
- the
SynsetRelations incident on thisSynset
-
getOutgoingEdges
List<E> getOutgoingEdges(T... edgeTypes)
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
default List<String> toURIs(ExternalResource resource)
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
void addStringTag(StringTag tag)
-
-