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.BabelNetIndexManagerindexManagerLucene index manager
-
Constructor Summary
Constructors Modifier Constructor Description protectedBabelNet()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.BabelNetIndexManagergetIndexManager()Returns theBabelNetIndexManagerstatic BabelNetgetInstance()Returns the singleton instance of theBabelNetclassprotected abstract List<BabelSynsetRelation>getOutgoingEdges(BabelSynsetID id)Returns the outgoing edges from a givenBabelSynsetIDprotected 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.BabelSynsetgetSynset(ResourceID resourceID)Given aResourceID, returns the synset identified by the ResourceID in input.BabelSynsetgetSynset(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 ofResourceIDs, 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 WordNetBabelSynsetsStream<it.uniroma1.lcl.jlt.ling.Word>lexiconStream()Returns the full stream ofBabelSynsetsStream<String>offsetStream()Returns the full stream of string offsets ofBabelSynsetsStream<BabelSense>senseStream()Returns the full stream ofBabelSensesStream<BabelSense>senseStream(BabelSenseSource source)Returns the full stream ofBabelSenses belonging to a givenBabelSenseSourceStream<BabelSense>senseStream(it.uniroma1.lcl.jlt.util.Language language)Returns the full stream ofBabelSenses in a givenLanguageStream<BabelSense>senseStream(it.uniroma1.lcl.jlt.util.Language language, BabelSenseSource source)Returns the full stream ofBabelSenses with the given constraintsStream<BabelSynset>stream()Returns the full stream ofBabelSynsets-
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 theBabelNetclass- 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- theBabelSenseSources 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- theBabelSenseSources 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- theBabelSenseSources 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- theBabelSenseSources 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:LKBReturns the senses of synsets containing the word in any language.- Specified by:
getSensesFromin 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:LKBReturns the senses of synsets containing the word in the given language.- Specified by:
getSensesFromin 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:LKBReturns the senses of synsets containing the word with the given constraints.- Specified by:
getSensesFromin 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:LKBReturns the senses of synsets containing the word in any language.- Specified by:
getSensesContainingin 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:LKBReturns the senses of synsets containing the word in the given language.- Specified by:
getSensesContainingin 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:LKBReturns the senses of synsets containing the word with the given constraints.- Specified by:
getSensesContainingin 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:LKBGiven a word, returns the synsets for the word.- Specified by:
getSynsetsin 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:LKBGiven a word in a certain language, returns the synsets for the word.- Specified by:
getSynsetsin 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:LKBGiven a word in a certain language, returns the synsets for the word.- Specified by:
getSynsetsin 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:LKBGiven a word and a collection of languages, returns the senses for the word available in the given sense sources.- Specified by:
getSynsetsin 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:LKBGiven a word and a collection of languages, returns the synsets for the word available in the given sense sources.- Specified by:
getSynsetsin 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:LKBGiven a list ofResourceIDs, returns the synsets identified by the ResourceIDs in input.- Specified by:
getSynsetsin interfaceLKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>- Parameters:
resourceIds- the resource identifiers- Returns:
- the synsets identified by the given
ResourceIDs
-
getSynset
public BabelSynset getSynset(ResourceID resourceID)
Description copied from interface:LKBGiven aResourceID, returns the synset identified by the ResourceID in input.Note: It is possible that this method gives a warning if the
ResourceIDreturns more than one synset. In that case the best (seeInternalBabelSynsetComparator) sense will be returned.- Specified by:
getSynsetin interfaceLKB<BabelSynset,BabelSense,BabelSynsetRelation,BabelPointer,BabelGloss,BabelExample,BabelNetQuery>- Parameters:
resourceID- the resource identifier- Returns:
- the synset identified by the
ResourceIDSome 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- theBabelSenseSources 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- theBabelSenseSources 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- theBabelSenseSources 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- theBabelSenseSources 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- theBabelSenseSources 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- theBabelSenseSources 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- theBabelSenseSources 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 ofResourceIDs, 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
ResourceIDs
-
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
ResourceIDreturns 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- theBabelSynsetIDwhose 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- theBabelSynsetIDwhose 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 ofBabelSynsets- Returns:
- the stream of
BabelSynsets
-
lexiconStream
public Stream<it.uniroma1.lcl.jlt.ling.Word> lexiconStream()
Returns the full stream ofBabelSynsets- Returns:
- the stream of
BabelSynsets
-
offsetStream
public Stream<String> offsetStream()
Returns the full stream of string offsets ofBabelSynsets- Returns:
- the stream of
BabelSynsets
-
getWordNetStream
public Stream<BabelSynset> getWordNetStream()
Returns the full stream of the WordNetBabelSynsets- Returns:
- the stream of the WordNet
BabelSynsets
-
senseStream
public Stream<BabelSense> senseStream()
Returns the full stream ofBabelSenses- Returns:
- the stream of
BabelSenses
-
senseStream
public Stream<BabelSense> senseStream(it.uniroma1.lcl.jlt.util.Language language)
Returns the full stream ofBabelSenses in a givenLanguage- Parameters:
language- the language of the senses- Returns:
- the stream of
BabelSenses
-
senseStream
public Stream<BabelSense> senseStream(BabelSenseSource source)
Returns the full stream ofBabelSenses belonging to a givenBabelSenseSource- Parameters:
source- the source of the senses- Returns:
- the stream of
BabelSenses
-
senseStream
public Stream<BabelSense> senseStream(it.uniroma1.lcl.jlt.util.Language language, BabelSenseSource source)
Returns the full stream ofBabelSenses with the given constraints- Parameters:
language- the language of the sensessource- the source of the senses- Returns:
- the stream of
BabelSenses
-
getIndexManager
protected it.uniroma1.lcl.babelnet.BabelNetIndexManager getIndexManager()
Returns theBabelNetIndexManager- Returns:
- the
BabelNetIndexManager
-
-