T
- the Synset
implementationS
- the Sense
implementationR
- the SynsetRelation
implementationE
- the SynsetRelationType
implementationG
- the Gloss
implementationX
- the Example
implementationQ
- the LKBQuery
implementation for querying over this LKBpublic interface LKB<T extends Synset<S,R,E,G,X>,S extends Sense,R extends SynsetRelation,E extends SynsetRelationType,G extends Gloss,X extends Example,Q extends LKBQuery> extends Iterable<T>
Modifier and Type | Method and Description |
---|---|
Iterator<it.uniroma1.lcl.jlt.ling.Word> |
getLexiconIterator()
Creates a new instance of a lexicon iterator
|
Iterator<String> |
getOffsetIterator()
Creates a new instance of an offset iterator.
|
List<S> |
getSensesContaining(Q query)
Returns the senses of synsets containing the word with the given constraints.
|
List<S> |
getSensesContaining(String word)
Returns the senses of synsets containing the word in any language.
|
List<S> |
getSensesContaining(String word,
it.uniroma1.lcl.jlt.util.Language language)
Returns the senses of synsets containing the word in the given language.
|
List<S> |
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<S> |
getSensesFrom(Q query)
Returns the senses of the synsets with the given constraints.
|
List<S> |
getSensesFrom(String word)
Returns the senses of synsets containing the word in any language.
|
List<S> |
getSensesFrom(String word,
it.uniroma1.lcl.jlt.util.Language language)
Returns the senses of synsets containing the word in the given language.
|
List<S> |
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.
|
T |
getSynset(ResourceID resourceID)
Given a
ResourceID , returns the synset identified by the ResourceID in input. |
List<T> |
getSynsets(Q query)
Returns the synsets for the word with the given constraints.
|
List<T> |
getSynsets(ResourceID... resourceIds)
Given a list of
ResourceID s, returns the synsets identified by the ResourceIDs in input. |
List<T> |
getSynsets(String word)
Given a word, returns the synsets for the word.
|
List<T> |
getSynsets(String word,
Collection<it.uniroma1.lcl.jlt.util.Language> searchLanguages)
Given a word and a collection of languages, returns the senses for the word available in the given sense sources.
|
List<T> |
getSynsets(String word,
Collection<it.uniroma1.lcl.jlt.util.Language> searchLanguages,
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<T> |
getSynsets(String word,
it.uniroma1.lcl.jlt.util.Language language)
Given a word in a certain language, returns the synsets for the word.
|
List<T> |
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.
|
Version |
getVersion()
Gets the version of loaded BabelNet indices
|
Iterator<BabelSynset> |
getWordNetSynsetIterator()
Creates a new instance of a WordNet iterator
|
Iterator<T> |
iterator()
Creates a new instance of
Synset iterator. |
default List<? extends T> |
toSynsets(ResourceID id)
Converts from
ResourceID to the corresponding Synset s. |
List<T> |
toSynsets(ResourceID id,
Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages)
Converts from
ResourceID to the corresponding Synset s. |
forEach, spliterator
List<S> getSensesContaining(String word)
word
- the word whose senses are to be retrieved.List<S> getSensesContaining(String word, it.uniroma1.lcl.jlt.util.Language language)
word
- the word whose senses are to be retrieved.language
- the language of the input word.List<S> getSensesContaining(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos)
word
- the word whose senses are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.List<S> getSensesContaining(Q query)
query
- the query (use a query builder to build it).List<S> getSensesFrom(String word)
word
- the word whose senses are to be retrieved.List<S> getSensesFrom(String word, it.uniroma1.lcl.jlt.util.Language language)
word
- the word whose senses are to be retrieved.language
- the language of the input word.List<S> getSensesFrom(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos)
word
- the word whose senses are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.List<S> getSensesFrom(Q query)
query
- the query (use a query builder to build it).List<T> getSynsets(String word)
word
- the word whose synsets are to be retrieved.List<T> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language)
word
- the word whose synsets are to be retrieved.language
- the language of the input word.List<T> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos)
word
- the word whose synsets are to be retrieved.language
- the language of the input word.pos
- the PoS of the word.List<T> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> searchLanguages)
word
- the word whose senses are to be retrieved.searchLanguages
- a collection of languages that can be used to look up the input word.List<T> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> searchLanguages, it.uniroma1.lcl.jlt.util.POS pos)
word
- the word whose synsets are to be retrieved.searchLanguages
- a collection of languages that can be used to look up the input word.pos
- the PoS of the word.List<T> getSynsets(ResourceID... resourceIds)
ResourceID
s, returns the synsets identified by the ResourceIDs in input.resourceIds
- the resource identifiersResourceID
sT getSynset(ResourceID resourceID)
ResourceID
, 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 (see InternalBabelSynsetComparator
) sense will be returned.
resourceID
- the resource identifierResourceID
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"));
List<T> getSynsets(Q query)
query
- the query (use a query builder to build it).Version getVersion()
BabelVersion
of BabelNet indicesIterator<String> getOffsetIterator()
Iterator<it.uniroma1.lcl.jlt.ling.Word> getLexiconIterator()
Iterator<BabelSynset> getWordNetSynsetIterator()
List<T> toSynsets(ResourceID id, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages)
ResourceID
to the corresponding Synset
s.id
- the input ResourceID
targetLanguages
- the target languages to populate synsets withdefault List<? extends T> toSynsets(ResourceID id)
ResourceID
to the corresponding Synset
s.id
- the input ResourceID
Copyright © 2016–2021. All rights reserved.