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>
- Type Parameters:
T- theSynsetimplementationS- theSenseimplementationR- theSynsetRelationimplementationE- theSynsetRelationTypeimplementationG- theGlossimplementationX- theExampleimplementationQ- theLKBQueryimplementation for querying over this LKB
- All Superinterfaces:
Iterable<T>
- All Known Implementing Classes:
BabelNet
public 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>
An abstract lexical knowledge base.
- Author:
- navigli
-
Method Summary
Modifier and TypeMethodDescriptionIterator<it.uniroma1.lcl.jlt.ling.Word> Creates a new instance of a lexicon iteratorCreates a new instance of an offset iterator.getSensesContaining(String word) Returns the senses of synsets containing the word in any language.getSensesContaining(String word, it.uniroma1.lcl.jlt.util.Language language) Returns the senses of synsets containing the word in the given language.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.getSensesContaining(Q query) Returns the senses of synsets containing the word with the given constraints.getSensesFrom(String word) Returns the senses of synsets containing the word in any language.getSensesFrom(String word, it.uniroma1.lcl.jlt.util.Language language) Returns the senses of synsets containing the word in the given language.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.getSensesFrom(Q query) Returns the senses of the synsets with the given constraints.getSynset(ResourceID resourceID) Given aResourceID, returns the synset identified by the ResourceID in input.getSynsets(ResourceID... resourceIds) Given a list ofResourceIDs, returns the synsets identified by the ResourceIDs in input.getSynsets(String word) Given a word, returns the synsets for the word.getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language) Given a word in a certain language, returns the synsets for the word.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.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.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.getSynsets(Q query) Returns the synsets for the word with the given constraints.Gets the version of loaded BabelNet indicesCreates a new instance of a WordNet iteratoriterator()Creates a new instance ofSynsetiterator.toSynsets(ResourceID id) Converts fromResourceIDto the correspondingSynsets.toSynsets(ResourceID id, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages) Converts fromResourceIDto the correspondingSynsets.Methods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
getSensesContaining
-
getSensesContaining
-
getSensesContaining
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.- 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
-
getSensesFrom
-
getSensesFrom
-
getSensesFrom
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.- 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.
-
getSensesFrom
-
getSynsets
-
getSynsets
-
getSynsets
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.- 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
Given a word and a collection of languages, returns the senses for the word available in the given sense sources.- Parameters:
word- the word whose senses are to be retrieved.searchLanguages- a collection of languages that can be used to look up the input word.- Returns:
- the senses of the word.
-
getSynsets
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.- Parameters:
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.- Returns:
- the synsets of the word.
-
getSynsets
Given a list ofResourceIDs, returns the synsets identified by the ResourceIDs in input.- Parameters:
resourceIds- the resource identifiers- Returns:
- the synsets identified by the given
ResourceIDs
-
getSynset
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:
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
-
getVersion
Version getVersion()Gets the version of loaded BabelNet indices- Returns:
- the
BabelVersionof BabelNet indices
-
iterator
-
getOffsetIterator
-
getLexiconIterator
Iterator<it.uniroma1.lcl.jlt.ling.Word> getLexiconIterator()Creates a new instance of a lexicon iterator- Returns:
- an instance of a lexicon iterator.
-
getWordNetSynsetIterator
Iterator<BabelSynset> getWordNetSynsetIterator()Creates a new instance of a WordNet iterator- Returns:
- an instance of a WordNet iterator.
-
toSynsets
Converts fromResourceIDto the correspondingSynsets.- Parameters:
id- the inputResourceIDtargetLanguages- the target languages to populate synsets with- Returns:
- the list of corresponding synsets
-
toSynsets
Converts fromResourceIDto the correspondingSynsets.- Parameters:
id- the inputResourceID- Returns:
- the list of corresponding synsets
-