class documentation

Implementation of a BNIndex

Method lexicon_iterator Create a new instance of a lexicon iterator.
Method licence_ids_from_resource_id Given a ResourceID, get a list of InternalBabelSynsetIDs.
Method license_ids_for_word Get the set of ids license for the word with the given constraints.
Method mapping_from_babelsynsetids Get a mapping from a list of BabelSynsetIDs
Method offset_iterator 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_iterator 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_from_resource_id Get a list of BabelSynset from a given ResourceID.
Method version The version of BabelNet.
Method wordnet_iterator Create a new instance of a wordnet iterator.
Method wordnet_offsets Retrieve WordNet 3.0 offset from old-version WordNet offSet.
def lexicon_iterator(self):

Create a new instance of a lexicon iterator.

Returns
BabelLexiconIteratorthe lexicon iterator
def licence_ids_from_resource_id(self, resource_id):

Given a ResourceID, get a list of InternalBabelSynsetIDs.

Parameters
resource_id:ResourceIDThe resource.
Returns
List[_InternalBabelSynsetID]The list of InternalBabelSynsetIDs associated to the given ResourceID.
def license_ids_for_word(self, word, poses, langs, normalizer):

Get the set of ids license for the word with the given constraints.

Parameters
word:strThe 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:boolTrue 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):

Get a mapping from a list of BabelSynsetIDs

Parameters
*ids:BabelSynsetIDCollection of BabelSynsetID
Returns
Dict[BabelSynsetID, List[_InternalBabelSynsetID]]For each BabelSynsetID returns the necessary indexes to create the BabelSynset
def offset_iterator(self):

Create a new instance of a offset iterator.

Returns
BabelOffsetIteratorthe babel offset iterator
def successors(self, id_):

Given a Babel id, collects the successors of the concept denoted by the id.

Parameters
id_:BabelSynsetIDA 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):

Create a new instance of a synset iterator.

Returns
BabelSynsetIteratorAn iterator over BabelNet's synsets
def synsets(self, id2license_ids, target_languages):

Construct the list of BabelSynsets from a map of BabelSynsetIDs to list of InternalBabelSynsetID.

Parameters
id2license_ids:Dict[BabelSynsetID, List[_InternalBabelSynsetID]]Map of BabelSynsetIDs to list of InternalBabelSynsetID.
target_languages:Set[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):

Get a list of BabelSynset from a given ResourceID.

Parameters
id_:ResourceIDThe ResourceID.
id2license_ids:Dict[BabelSynsetID, List[_InternalBabelSynsetID]]a dict that maps BabelSynsetID to a list of _InternalBabelSynsetID
target_langs:Set[Language]The output language
Returns
List[BabelSynset]The list of BabelSynsets associated to the given ResourceID.
def version(self):

The version of BabelNet.

Returns
BabelVersionthe version
def wordnet_iterator(self):

Create a new instance of a wordnet iterator.

Returns
WordNetSynsetIteratoran iterator over Wordnet's synsets
def wordnet_offsets(self, offset, version):

Retrieve WordNet 3.0 offset from old-version WordNet offSet.

Parameters
offset:strThe wordnet offset
version:WordNetVersionthe wordnet version
Returns
List[WordNetSynsetID]A list of WordNetSynsetID at the specified offset for that specified version
Raises
InvalidSynsetIDError
JavaError