class documentation
Implementation of a BNIndex
Method | lexicon |
Create a new instance of a lexicon iterator. |
Method | licence |
Given a ResourceID, get a list of InternalBabelSynsetIDs. |
Method | license |
Get the set of ids license for the word with the given constraints. |
Method | mapping |
Get a mapping from a list of BabelSynsetIDs |
Method | offset |
Create a new instance of a offset iterator. |
Method | successors |
Given a Babel id, collects the successors of the concept denoted by the id. |
Method | synset |
Create a new instance of a synset iterator. |
Method | synsets |
Construct the list of BabelSynsets from a map of BabelSynsetIDs to list of InternalBabelSynsetID. |
Method | synsets |
Get a list of BabelSynset from a given ResourceID. |
Method | version |
The version of BabelNet. |
Method | wordnet |
Create a new instance of a wordnet iterator. |
Method | wordnet |
Retrieve WordNet 3.0 offset from old-version WordNet offSet. |
def lexicon_iterator(self):
overridden in
babelnet.indices.local_index.OfflineIndex
Create a new instance of a lexicon iterator.
Returns | |
BabelLexiconIterator | the lexicon iterator |
def licence_ids_from_resource_id(self, resource_id):
overridden in
babelnet.indices.local_index.OfflineIndex
Given a ResourceID, get a list of InternalBabelSynsetIDs.
Parameters | |
resourceResourceID | The resource. |
Returns | |
List[_InternalBabelSynsetID] | The list of InternalBabelSynsetIDs associated to the given ResourceID. |
def license_ids_for_word(self, word, poses, langs, normalizer):
overridden in
babelnet.indices.local_index.OfflineIndex
Get the set of ids license for the word with the given constraints.
Parameters | |
word:str | The word whose senses are to be retrieved. |
poses:Set[POS] | The PoSes of the word to be retrieved. |
langs:Set[Language] | The search languages for the input word. |
normalizer:bool | True if normalization should be applied when searching. |
Returns | |
List[_InternalBabelSynsetID] | The list of InternalBabelSynsetIDs associated with the given constraints. |
def mapping_from_babelsynsetids(self, *ids):
overridden in
babelnet.indices.local_index.OfflineIndex
Get a mapping from a list of BabelSynsetIDs
Parameters | |
*ids:BabelSynsetID | Collection of BabelSynsetID |
Returns | |
Dict[BabelSynsetID , List[_InternalBabelSynsetID]] | For each BabelSynsetID returns the necessary indexes to create the BabelSynset |
def offset_iterator(self):
overridden in
babelnet.indices.local_index.OfflineIndex
Create a new instance of a offset iterator.
Returns | |
BabelOffsetIterator | the babel offset iterator |
def successors(self, id_):
overridden in
babelnet.indices.local_index.OfflineIndex
Given a Babel id, collects the successors of the concept denoted by the id.
Parameters | |
id_:BabelSynsetID | A concept identifier (BabelSynsetID) |
Returns | |
Optional[List[str]] | Return a stringified representation of the edges departing from the Babel synset denoted by the input id. |
def synset_iterator(self):
overridden in
babelnet.indices.local_index.OfflineIndex
Create a new instance of a synset iterator.
Returns | |
BabelSynsetIterator | An iterator over BabelNet's synsets |
def synsets(self, id2license_ids, target_languages):
overridden in
babelnet.indices.local_index.OfflineIndex
Construct the list of BabelSynsets from a map of BabelSynsetIDs to list of InternalBabelSynsetID.
Parameters | |
id2licenseDict[BabelSynsetID , List[_InternalBabelSynsetID]] | Map of BabelSynsetIDs to list of InternalBabelSynsetID. |
targetSet[Language] | The languages to include in the synsets. |
Returns | |
List[BabelSynset] | The list of constructed synsets. |
def synsets_from_resource_id(self, id_, id2license_ids, target_langs):
overridden in
babelnet.indices.local_index.OfflineIndex
Get a list of BabelSynset from a given ResourceID.
Parameters | |
id_:ResourceID | The ResourceID. |
id2licenseDict[BabelSynsetID , List[_InternalBabelSynsetID]] | a dict that maps BabelSynsetID to a list of _InternalBabelSynsetID |
targetSet[Language] | The output language |
Returns | |
List[BabelSynset] | The list of BabelSynsets associated to the given ResourceID. |
def version(self):
overridden in
babelnet.indices.local_index.OfflineIndex
The version of BabelNet.
Returns | |
BabelVersion | the version |
def wordnet_iterator(self):
overridden in
babelnet.indices.local_index.OfflineIndex
Create a new instance of a wordnet iterator.
Returns | |
WordNetSynsetIterator | an iterator over Wordnet's synsets |
def wordnet_offsets(self, offset, version):
overridden in
babelnet.indices.local_index.OfflineIndex
Retrieve WordNet 3.0 offset from old-version WordNet offSet.
Parameters | |
offset:str | The wordnet offset |
version:WordNetVersion | the wordnet version |
Returns | |
List[WordNetSynsetID] | A list of WordNetSynsetID at the specified offset for that specified version |
Raises | |
InvalidSynsetIDError | |
JavaError |