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
- theSense
typeE
- theSynsetRelation
type for relations between synsetsG
- theGloss
(i.e. definition) typeX
- theExample
type
- 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 void
addStringTag(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)
SynsetID
getID()
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 allSynsetRelation
edges of theSynsetRelationType
s given as input for thisSynsetRelation
.it.uniroma1.lcl.jlt.util.POS
getPOS()
Gets the part of speech of thisSynset
.List<S>
getSenses()
Get the senses contained in thisSynset
List<S>
getSenses(it.uniroma1.lcl.jlt.util.Language language)
Get the senses contained in thisSynset
for an input languageList<S>
getSenses(it.uniroma1.lcl.jlt.util.Language language, SenseSource source)
Get the senses contained in thisSynset
for an input language and sense sourceList<S>
getSenses(SenseSource source)
Get the senses contained in thisSynset
for an input sense sourceList<S>
getSenses(String lemma, it.uniroma1.lcl.jlt.util.Language language, boolean normalized, SenseSource... sources)
Gets theSense
s for the input word in the given languagedefault List<S>
getSenses(String lemma, it.uniroma1.lcl.jlt.util.Language language, SenseSource... sources)
Gets theSense
s for the input word in the given languageList<? extends SenseSource>
getSenseSources()
Collects allSenseSource
s contained for thisSynset
.SynsetType
getType()
Gets the type of thisSynset
, namely whether it's an entity, a concept, etc.boolean
retainSenses(Predicate<? super S> predicate)
Retains all the senses which pass the predicate testdefault boolean
retainSenses(List<Predicate<? super S>> predicates)
Retains all the senses which pass the predicate testsint
size()
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 givenExternalResource
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
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
-
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 thisSynset
for 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 thisSynset
for 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 thisSynset
for 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 theSense
s 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
Sense
s 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 theSense
s 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
Sense
s 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
Gloss
for 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
Synset
for the input source
-
getGlosses
default List<G> getGlosses(SenseSource source)
- Parameters:
source
- the gloss source- Returns:
- all glosses of this
Synset
for 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
Synset
for the input language
-
getMainExample
Optional<X> getMainExample(it.uniroma1.lcl.jlt.util.Language lang)
- Parameters:
lang
- the example language- Returns:
- the main
Example
for 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
Synset
for the input language
-
getExamples
default List<X> getExamples(SenseSource source)
- Parameters:
source
- the example source- Returns:
- all examples of this
Synset
for 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
Synset
for the input language and source
-
getSenseSources
List<? extends SenseSource> getSenseSources()
Collects allSenseSource
s contained for thisSynset
.- Returns:
- a list of
SenseSource
s
-
getOutgoingEdges
default List<E> getOutgoingEdges()
- Returns:
- the
SynsetRelation
s incident on thisSynset
-
getOutgoingEdges
List<E> getOutgoingEdges(T... edgeTypes)
Collects allSynsetRelation
edges of theSynsetRelationType
s given as input for thisSynsetRelation
.- Parameters:
edgeTypes
- the types of the edges connecting this synset to other synsets- Returns:
- only the
SynsetRelation
s tagged with theSynsetRelationType
s 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)
-
-