Package it.uniroma1.lcl.babelnet
Class BabelNet
- java.lang.Object
-
- it.uniroma1.lcl.babelnet.BabelNet
-
- All Implemented Interfaces:
LKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>
,Iterable<BabelSynset>
public abstract class BabelNet extends Object implements LKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>
A class to programmatically access BabelNet.- Author:
- navigli, vannella, cecconi
-
-
Field Summary
Fields Modifier and Type Field Description protected static it.uniroma1.lcl.babelnet.BabelNetIndexManager
indexManager
Lucene index manager
-
Constructor Summary
Constructors Modifier Constructor Description protected
BabelNet()
BabelNet default constructor
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected it.uniroma1.lcl.babelnet.BabelNetIndexManager
getIndexManager()
Returns theBabelNetIndexManager
static BabelNet
getInstance()
Returns the singleton instance of theBabelNet
classprotected abstract List<BabelSynsetRelation>
getOutgoingEdges(BabelSynsetID id)
Returns the outgoing edges from a givenBabelSynsetID
protected abstract List<BabelSynsetRelation>
getOutgoingEdges(BabelSynsetID id, Collection<it.uniroma1.lcl.jlt.util.Language> searchLangs)
Deprecated.List<BabelSense>
getSenses(String word)
Deprecated.List<BabelSense>
getSenses(String word, it.uniroma1.lcl.jlt.util.Language language)
Deprecated.List<BabelSense>
getSenses(String word, it.uniroma1.lcl.jlt.util.Language language, boolean normalized)
Deprecated.List<BabelSense>
getSenses(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos)
Deprecated.List<BabelSense>
getSenses(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, boolean normalized, BabelSenseSource... allowedSources)
Deprecated.List<BabelSense>
getSenses(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, BabelSenseSource... allowedSources)
Deprecated.List<BabelSense>
getSenses(String word, it.uniroma1.lcl.jlt.util.Language searchLanguage, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages)
Deprecated.List<BabelSense>
getSenses(String word, it.uniroma1.lcl.jlt.util.Language searchLanguage, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages, boolean normalized)
Deprecated.List<BabelSense>
getSenses(String word, it.uniroma1.lcl.jlt.util.Language sourceLanguage, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages, boolean normalized, BabelSenseSource... allowedSources)
Deprecated.List<BabelSense>
getSenses(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, BabelSenseSource... allowedSources)
Deprecated.List<BabelSense>
getSenses(String word, it.uniroma1.lcl.jlt.util.Language searchLanguage, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages)
Deprecated.List<BabelSense>
getSenses(String word, it.uniroma1.lcl.jlt.util.Language searchLanguage, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages, boolean normalized)
Deprecated.List<BabelSense>
getSensesContaining(String word)
Returns the senses of synsets containing the word in any language.List<BabelSense>
getSensesContaining(String word, it.uniroma1.lcl.jlt.util.Language language)
Returns the senses of synsets containing the word in the given language.List<BabelSense>
getSensesContaining(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos)
Returns the senses of synsets containing the word with the given constraints.List<BabelSense>
getSensesFrom(String word)
Returns the senses of synsets containing the word in any language.List<BabelSense>
getSensesFrom(String word, it.uniroma1.lcl.jlt.util.Language language)
Returns the senses of synsets containing the word in the given language.List<BabelSense>
getSensesFrom(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos)
Returns the senses of synsets containing the word with the given constraints.BabelSynset
getSynset(ResourceID resourceID)
Given aResourceID
, returns the synset identified by the ResourceID in input.BabelSynset
getSynset(Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, ResourceID resourceID)
Deprecated.Iterator<BabelSynset>
getSynsetIterator()
Deprecated.Please useLKB.iterator()
.List<BabelSynset>
getSynsets(ResourceID... resourceIds)
Given a list ofResourceID
s, returns the synsets identified by the ResourceIDs in input.List<BabelSynset>
getSynsets(String word)
Given a word, returns the synsets for the word.List<BabelSynset>
getSynsets(String word, boolean normalized)
Deprecated.List<BabelSynset>
getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language)
Given a word in a certain language, returns the synsets for the word.List<BabelSynset>
getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, boolean normalized)
Deprecated.List<BabelSynset>
getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos)
Given a word in a certain language, returns the synsets for the word.List<BabelSynset>
getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, boolean normalized)
Deprecated.List<BabelSynset>
getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, boolean normalized, BabelSenseSource... allowedSources)
Deprecated.List<BabelSynset>
getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, BabelSenseSource... allowedSources)
Deprecated.List<BabelSynset>
getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs)
Deprecated.List<BabelSynset>
getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized)
Deprecated.List<BabelSynset>
getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized, BabelSenseSource... allowedSources)
Deprecated.List<BabelSynset>
getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, BabelSenseSource... allowedSources)
Deprecated.List<BabelSynset>
getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs)
Deprecated.List<BabelSynset>
getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized)
Deprecated.List<BabelSynset>
getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> searchLangs)
Given a word and a collection of languages, returns the senses for the word available in the given sense sources.List<BabelSynset>
getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, boolean normalized)
Deprecated.List<BabelSynset>
getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> searchLangs, it.uniroma1.lcl.jlt.util.POS pos)
Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.List<BabelSynset>
getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, boolean normalized)
Deprecated.List<BabelSynset>
getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, boolean normalized, BabelSenseSource... allowedSources)
Deprecated.List<BabelSynset>
getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, BabelSenseSource... allowedSources)
Deprecated.List<BabelSynset>
getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs)
Deprecated.List<BabelSynset>
getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized)
Deprecated.List<BabelSynset>
getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized, BabelSenseSource... allowedSources)
Deprecated.List<BabelSynset>
getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, BabelSenseSource... allowedSources)
Deprecated.List<BabelSynset>
getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs)
Deprecated.List<BabelSynset>
getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized)
Deprecated.List<BabelSynset>
getSynsets(Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, ResourceID... resourceIds)
Deprecated.Stream<BabelSynset>
getWordNetStream()
Returns the full stream of the WordNetBabelSynset
sStream<it.uniroma1.lcl.jlt.ling.Word>
lexiconStream()
Returns the full stream ofBabelSynset
sStream<String>
offsetStream()
Returns the full stream of string offsets ofBabelSynset
sStream<BabelSense>
senseStream()
Returns the full stream ofBabelSense
sStream<BabelSense>
senseStream(BabelSenseSource source)
Returns the full stream ofBabelSense
s belonging to a givenBabelSenseSource
Stream<BabelSense>
senseStream(it.uniroma1.lcl.jlt.util.Language language)
Returns the full stream ofBabelSense
s in a givenLanguage
Stream<BabelSense>
senseStream(it.uniroma1.lcl.jlt.util.Language language, BabelSenseSource source)
Returns the full stream ofBabelSense
s with the given constraintsStream<BabelSynset>
stream()
Returns the full stream ofBabelSynset
s-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface it.uniroma1.lcl.kb.LKB
getLexiconIterator, getOffsetIterator, getSensesContaining, getSensesFrom, getSynsets, getVersion, getWordNetSynsetIterator, iterator, toSynsets, toSynsets
-
-
-
-
Method Detail
-
getInstance
public static BabelNet getInstance()
Returns the singleton instance of theBabelNet
class- Returns:
- the instance of
BabelNet
-
getSenses
@Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language language, boolean normalized)
Deprecated.Returns the senses for the word with the given constraints.- Parameters:
word
- the word whose senses are to be retrieved.language
- the language of the input word.normalized
- enables normalized search- Returns:
- the senses of the word.
-
getSenses
@Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language searchLanguage, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages)
Deprecated.Returns the senses for the word with the given constraints.- Parameters:
word
- the word whose senses are to be retrieved.searchLanguage
- the language of the input word.targetLanguages
- the languages in which the data are to be retrieved.- Returns:
- the senses of the word.
-
getSenses
@Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language searchLanguage, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages, boolean normalized)
Deprecated.Returns the senses for the word with the given constraints.- Parameters:
word
- the word whose senses are to be retrieved.searchLanguage
- the language of the input word.targetLanguages
- the languages in which the data are to be retrieved.normalized
- enables normalized search- Returns:
- the senses of the word.
-
getSenses
@Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language searchLanguage, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages)
Deprecated.Returns the senses for the word with the given constraints.- Parameters:
word
- the word whose senses are to be retrieved.searchLanguage
- the language of the input word.pos
- the PoS of the word.targetLanguages
- the languages in which the data are to be retrieved.- Returns:
- the senses of the word.
-
getSenses
@Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language searchLanguage, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages, boolean normalized)
Deprecated.Returns the senses for the word with the given constraints.- Parameters:
word
- the word whose senses are to be retrieved.searchLanguage
- the language of the input word.pos
- the PoS of the word.targetLanguages
- the languages in which the data are to be retrieved.normalized
- enables normalized search- Returns:
- the senses of the word.
-
getSenses
@Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, BabelSenseSource... allowedSources)
Deprecated.Returns the senses for the word with the given constraints.- Parameters:
word
- the word whose senses are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.allowedSources
- theBabelSenseSource
s that can be used to look up the possible senses of the input word.- Returns:
- the senses of the word.
-
getSenses
@Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, boolean normalized, BabelSenseSource... allowedSources)
Deprecated.Returns the senses for the word with the given constraints.- Parameters:
word
- the word whose senses are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.normalized
- enables normalized searchallowedSources
- theBabelSenseSource
s that can be used to look up the possible senses of the input word.- Returns:
- the senses of the word.
-
getSenses
@Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, BabelSenseSource... allowedSources)
Deprecated.Returns the senses for the word with the given constraints.- Parameters:
word
- the word whose senses are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.targetLangs
- the languages in which the data are to be retrieved.allowedSources
- theBabelSenseSource
s that can be used to look up the possible senses of the input word.- Returns:
- the senses of the word.
-
getSenses
@Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language sourceLanguage, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages, boolean normalized, BabelSenseSource... allowedSources)
Deprecated.Returns the senses for the word with the given constraints.- Parameters:
word
- the word whose senses are to be retrieved.sourceLanguage
- the language of the input word.pos
- the PoS of the word.targetLanguages
- the languages in which the data are to be retrieved.normalized
- enables normalized searchallowedSources
- theBabelSenseSource
s that can be used to look up the possible senses of the input word.- Returns:
- the senses of the word.
-
getSensesFrom
public List<BabelSense> getSensesFrom(String word)
Description copied from interface:LKB
Returns the senses of synsets containing the word in any language.- Specified by:
getSensesFrom
in interfaceLKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>
- Parameters:
word
- the word whose senses are to be retrieved.- Returns:
- the senses of the word.
-
getSensesFrom
public List<BabelSense> getSensesFrom(String word, it.uniroma1.lcl.jlt.util.Language language)
Description copied from interface:LKB
Returns the senses of synsets containing the word in the given language.- Specified by:
getSensesFrom
in interfaceLKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>
- Parameters:
word
- the word whose senses are to be retrieved.language
- the language of the input word.- Returns:
- the senses of the word.
-
getSensesFrom
public List<BabelSense> getSensesFrom(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos)
Description copied from interface:LKB
Returns the senses of synsets containing the word with the given constraints.- Specified by:
getSensesFrom
in interfaceLKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>
- Parameters:
word
- the word whose senses are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.- Returns:
- the senses of the word.
-
getSensesContaining
public List<BabelSense> getSensesContaining(String word)
Description copied from interface:LKB
Returns the senses of synsets containing the word in any language.- Specified by:
getSensesContaining
in interfaceLKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>
- Parameters:
word
- the word whose senses are to be retrieved.- Returns:
- the senses of the word.
-
getSensesContaining
public List<BabelSense> getSensesContaining(String word, it.uniroma1.lcl.jlt.util.Language language)
Description copied from interface:LKB
Returns the senses of synsets containing the word in the given language.- Specified by:
getSensesContaining
in interfaceLKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>
- Parameters:
word
- the word whose senses are to be retrieved.language
- the language of the input word.- Returns:
- the senses of the word.
-
getSensesContaining
public List<BabelSense> getSensesContaining(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos)
Description copied from interface:LKB
Returns the senses of synsets containing the word with the given constraints.- Specified by:
getSensesContaining
in interfaceLKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>
- Parameters:
word
- the word whose senses are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.- Returns:
- the senses of the word.
-
getSenses
@Deprecated public List<BabelSense> getSenses(String word)
Deprecated.Returns the senses of synsets containing the word in any language.- Parameters:
word
- the word whose senses are to be retrieved.- Returns:
- the senses of the word.
-
getSenses
@Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language language)
Deprecated.Returns the senses of synsets containing the word in the given language.- Parameters:
word
- the word whose senses are to be retrieved.language
- the language of the input word.- Returns:
- the senses of the word.
-
getSenses
@Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos)
Deprecated.Returns the senses of synsets containing the word with the given constraints.- Parameters:
word
- the word whose senses are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.- Returns:
- the senses of the word.
-
getSynsets
public List<BabelSynset> getSynsets(String word)
Description copied from interface:LKB
Given a word, returns the synsets for the word.- Specified by:
getSynsets
in interfaceLKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>
- Parameters:
word
- the word whose synsets are to be retrieved.- Returns:
- the synsets of the word.
-
getSynsets
public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language)
Description copied from interface:LKB
Given a word in a certain language, returns the synsets for the word.- Specified by:
getSynsets
in interfaceLKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>
- Parameters:
word
- the word whose synsets are to be retrieved.language
- the language of the input word.- Returns:
- the synsets of the word.
-
getSynsets
public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos)
Description copied from interface:LKB
Given a word in a certain language, returns the synsets for the word.- Specified by:
getSynsets
in interfaceLKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>
- Parameters:
word
- the word whose synsets are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.- Returns:
- the synsets of the word.
-
getSynsets
public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> searchLangs)
Description copied from interface:LKB
Given a word and a collection of languages, returns the senses for the word available in the given sense sources.- Specified by:
getSynsets
in interfaceLKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>
- Parameters:
word
- the word whose senses are to be retrieved.searchLangs
- a collection of languages that can be used to look up the input word.- Returns:
- the senses of the word.
-
getSynsets
public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> searchLangs, it.uniroma1.lcl.jlt.util.POS pos)
Description copied from interface:LKB
Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.- Specified by:
getSynsets
in interfaceLKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>
- Parameters:
word
- the word whose synsets are to be retrieved.searchLangs
- a collection of languages that can be used to look up the input word.pos
- the PoS of the word.- Returns:
- the synsets of the word.
-
getSynsets
public List<BabelSynset> getSynsets(ResourceID... resourceIds)
Description copied from interface:LKB
Given a list ofResourceID
s, returns the synsets identified by the ResourceIDs in input.- Specified by:
getSynsets
in interfaceLKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>
- Parameters:
resourceIds
- the resource identifiers- Returns:
- the synsets identified by the given
ResourceID
s
-
getSynset
public BabelSynset getSynset(ResourceID resourceID)
Description copied from interface:LKB
Given aResourceID
, returns the synset identified by the ResourceID in input.Note: It is possible that this method gives a warning if the
ResourceID
returns more than one synset. In that case the best (seeInternalBabelSynsetComparator
) sense will be returned.- Specified by:
getSynset
in interfaceLKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>
- Parameters:
resourceID
- the resource identifier- Returns:
- the synset identified by the
ResourceID
Some examples that can be used follow, assuming:
BabelNet bn = BabelNet.getInstance();
Retrieving BabelSynset from a Wikipedia page title:
BabelSynset synset = bn.getSynset(new WikipediaID("BabelNet", Language.EN, BabelPOS.NOUN));
Retrieving BabelSynset from a Wikiquote page title:
BabelSynset synset = bn.getSynset(new WikiquoteID("Home", Language.EN, BabelPOS.NOUN));
Retrieving BabelSynset from a WordNet id:
BabelSynset synset = bn.getSynset(new WordNetSynsetID("wn:03544360n"));
Retrieving BabelSynset from a Wikidata page id:
BabelSynset synset = bn.getSynset(new WikidataID("Q4837690"));
Retrieving BabelSynset from a OmegaWiki page id:
BabelSynset synset = bn.getSynset(new OmegaWikiID("1499705"));
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, boolean normalized)
Deprecated.Given a word, returns the synsets for the word.- Parameters:
word
- the word whose synsets are to be retrieved.normalized
- enables normalized search- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, boolean normalized)
Deprecated.Given a word in a certain language, returns the synsets for the word.- Parameters:
word
- the word whose synsets are to be retrieved.language
- the language of the input word.normalized
- enables normalized search- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs)
Deprecated.Given a word in a certain language, returns the synsets for the word.- Parameters:
word
- the word whose synsets are to be retrieved.language
- the language of the input word.targetLangs
- the languages in which the data are to be retrieved.- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized)
Deprecated.Given a word in a certain language, returns the synsets for the word.- Parameters:
word
- the word whose synsets are to be retrieved.language
- the language of the input word.targetLangs
- the languages in which the data are to be retrieved.normalized
- enables normalized search- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, boolean normalized)
Deprecated.Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.- Parameters:
word
- the word whose synsets are to be retrieved.langs
- a collection of languages that can be used to look up the input word.normalized
- enables normalized search- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs)
Deprecated.Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.- Parameters:
word
- the word whose synsets are to be retrieved.langs
- a collection of languages that can be used to look up the input word.targetLangs
- the languages in which the data are to be retrieved.- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized)
Deprecated.Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.- Parameters:
word
- the word whose synsets are to be retrieved.langs
- a collection of languages that can be used to look up the input word.targetLangs
- the languages in which the data are to be retrieved.normalized
- enables normalized search- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, boolean normalized)
Deprecated.Given a word in a certain language, returns the synsets for the word.- Parameters:
word
- the word whose synsets are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.normalized
- enables normalized search- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs)
Deprecated.Given a word in a certain language, returns the synsets for the word.- Parameters:
word
- the word whose synsets are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.targetLangs
- the languages in which the data are to be retrieved.- Returns:
- the synsets of the word.
-
getSynsets
public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized)
Deprecated.Given a word in a certain language, returns the synsets for the word.- Parameters:
word
- the word whose synsets are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.targetLangs
- the languages in which the data are to be retrieved.normalized
- enables normalized search- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, boolean normalized)
Deprecated.Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.- Parameters:
word
- the word whose synsets are to be retrieved.langs
- a collection of languages that can be used to look up the input word.pos
- the PoS of the word.normalized
- enables normalized search- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs)
Deprecated.Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.- Parameters:
word
- the word whose synsets are to be retrieved.langs
- a collection of languages that can be used to look up the input word.pos
- the PoS of the word.targetLangs
- the languages in which the data are to be retrieved.- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized)
Deprecated.Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.- Parameters:
word
- the word whose synsets are to be retrieved.langs
- a collection of languages that can be used to look up the input word.pos
- the PoS of the word.targetLangs
- the languages in which the data are to be retrieved.normalized
- enables normalized search- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, BabelSenseSource... allowedSources)
Deprecated.Given a word in a certain language, returns the synsets for the word available in the given sense sources.- Parameters:
word
- the word whose synsets are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.allowedSources
- theBabelSenseSource
s that can be used to look up the possible senses of the input word.- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, boolean normalized, BabelSenseSource... allowedSources)
Deprecated.Given a word in a certain language, returns the synsets for the word available in the given sense sources.- Parameters:
word
- the word whose synsets are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.normalized
- enables normalized searchallowedSources
- theBabelSenseSource
s that can be used to look up the possible senses of the input word.- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, BabelSenseSource... allowedSources)
Deprecated.Given a word in a certain language, returns the synsets for the word available in the given sense sources.- Parameters:
word
- the word whose synsets are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.targetLangs
- the languages in which the data are to be retrieved.allowedSources
- theBabelSenseSource
s that can be used to look up the possible senses of the input word.- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized, BabelSenseSource... allowedSources)
Deprecated.Given a word in a certain language, returns the synsets for the word available in the given sense sources.- Parameters:
word
- the word whose synsets are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.targetLangs
- the languages in which the data are to be retrieved.normalized
- enables normalized searchallowedSources
- sources used to search- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, BabelSenseSource... allowedSources)
Deprecated.Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.- Parameters:
word
- the word whose synsets are to be retrieved.langs
- a collection of languages that can be used to look up the input word.pos
- the PoS of the word.allowedSources
- theBabelSenseSource
s that can be used to look up the possible senses of the input word.- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, boolean normalized, BabelSenseSource... allowedSources)
Deprecated.Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.- Parameters:
word
- the word whose synsets are to be retrieved.langs
- a collection of languages that can be used to look up the input word.pos
- the PoS of the word.normalized
- enables normalized searchallowedSources
- theBabelSenseSource
s that can be used to look up the possible senses of the input word.- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, BabelSenseSource... allowedSources)
Deprecated.Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.- Parameters:
word
- the word whose synsets are to be retrieved.langs
- a collection of languages that can be used to look up the input word.pos
- the PoS of the word.targetLangs
- the languages in which the data are to be retrieved.allowedSources
- theBabelSenseSource
s that can be used to look up the possible senses of the input word.- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized, BabelSenseSource... allowedSources)
Deprecated.Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.- Parameters:
word
- the word whose synsets are to be retrieved.langs
- a collection of languages that can be used to look up the input word.pos
- the PoS of the word.targetLangs
- the languages in which the data are to be retrieved.normalized
- enables normalized searchallowedSources
- theBabelSenseSource
s that can be used to look up the possible senses of the input word.- Returns:
- the synsets of the word.
-
getSynsets
@Deprecated public List<BabelSynset> getSynsets(Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, ResourceID... resourceIds)
Deprecated.Given a list ofResourceID
s, returns the synsets identified by the ResourceIDs in input.- Parameters:
targetLangs
- the languages in which the data are to be retrieved.resourceIds
- the resource identifiers- Returns:
- the synsets identified by the given
ResourceID
s
-
getSynset
@Deprecated public BabelSynset getSynset(Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, ResourceID resourceID)
Deprecated.Given aResourceID
, returns the synset identified by the ResourceID in input.Note: It is possible that this method gives a warning if the
ResourceID
returns more than one synset. In that case the best (seeInternalBabelSynsetComparator
) sense will be returned.- Parameters:
targetLangs
- the languages in which the data are to be retrieved.resourceID
- the resource identifier- Returns:
- the synset identified by the
ResourceID
-
getOutgoingEdges
@Deprecated protected abstract List<BabelSynsetRelation> getOutgoingEdges(BabelSynsetID id, Collection<it.uniroma1.lcl.jlt.util.Language> searchLangs)
Deprecated.Returns the outgoing edges from a givenBabelSynsetID
- Parameters:
id
- theBabelSynsetID
whose outgoing edges we want to retrievesearchLangs
- the search languages of the edges- Returns:
- the list of relation edges
-
getOutgoingEdges
protected abstract List<BabelSynsetRelation> getOutgoingEdges(BabelSynsetID id)
Returns the outgoing edges from a givenBabelSynsetID
- Parameters:
id
- theBabelSynsetID
whose outgoing edges we want to retrieve- Returns:
- the list of relation edges
-
getSynsetIterator
@Deprecated public Iterator<BabelSynset> getSynsetIterator()
Deprecated.Please useLKB.iterator()
.Creates a new instance ofBabelSynsetIterator
.- Returns:
- an instance of a
BabelSynsetIterator
.
-
stream
public Stream<BabelSynset> stream()
Returns the full stream ofBabelSynset
s- Returns:
- the stream of
BabelSynset
s
-
lexiconStream
public Stream<it.uniroma1.lcl.jlt.ling.Word> lexiconStream()
Returns the full stream ofBabelSynset
s- Returns:
- the stream of
BabelSynset
s
-
offsetStream
public Stream<String> offsetStream()
Returns the full stream of string offsets ofBabelSynset
s- Returns:
- the stream of
BabelSynset
s
-
getWordNetStream
public Stream<BabelSynset> getWordNetStream()
Returns the full stream of the WordNetBabelSynset
s- Returns:
- the stream of the WordNet
BabelSynset
s
-
senseStream
public Stream<BabelSense> senseStream()
Returns the full stream ofBabelSense
s- Returns:
- the stream of
BabelSense
s
-
senseStream
public Stream<BabelSense> senseStream(it.uniroma1.lcl.jlt.util.Language language)
Returns the full stream ofBabelSense
s in a givenLanguage
- Parameters:
language
- the language of the senses- Returns:
- the stream of
BabelSense
s
-
senseStream
public Stream<BabelSense> senseStream(BabelSenseSource source)
Returns the full stream ofBabelSense
s belonging to a givenBabelSenseSource
- Parameters:
source
- the source of the senses- Returns:
- the stream of
BabelSense
s
-
senseStream
public Stream<BabelSense> senseStream(it.uniroma1.lcl.jlt.util.Language language, BabelSenseSource source)
Returns the full stream ofBabelSense
s with the given constraints- Parameters:
language
- the language of the sensessource
- the source of the senses- Returns:
- the stream of
BabelSense
s
-
getIndexManager
protected it.uniroma1.lcl.babelnet.BabelNetIndexManager getIndexManager()
Returns theBabelNetIndexManager
- Returns:
- the
BabelNetIndexManager
-
-