class documentation

A Babel synset in BabelNet with all the operations.

Method __init__ init method
Method categories Get the categories (BabelCategory) of this BabelSynset in the specified languages (if not specified, return all categories).
Method examples Collect all Examples for this Synset.
Method get_string_tags The tags of this synset as string
Method glosses Collect all Glosses for this Synset.
Method lemmas Return the lemmas in this BabelSynset sorted by relevance and type.
Method main_example Get the main Example for this Synset.
Method main_gloss Get the main Gloss in the given language, if any.
Method main_sense Get the main BabelSense by importance of this BabelSynset.
Method main_sense_preferably_in Get the main BabelSense by importance of this BabelSynset, preferrably in the given language.
Method main_senses Collect distinct BabelSenses sorted by importance to this BabelSynset for a given language.
Method outgoing_edges Collect all Synset edges incident on this Synset.
Method retain_senses Retain all the senses which pass the predicate tests.
Method senses Get the senses contained in this Synset.
Method senses_by_word Gets the Senses for the input word in the given language.
Method to_str Return the string representation of the BabelSenses of this BabelSynset only for a specific set of languages.
Method to_uris Return the URIs of the various senses in the given languages in the synset for a given ExternalResource.
Method wordnet_offset_map_from Obtain a map from WordNetSynsetID of the input WordNetVersion to the current version of WordNet (3.0 as of 2016).
Method wordnet_offset_map_to Obtain a map from the current version of WordNet (3.0 as of 2016) to WordNetSynsetIDs of the input WordNetVersion.
Instance Variable id The id of the synset.
Property domains The BabelDomains of this BabelSynset.
Property frame_id Return the FrameID associated with this synset.
Property images The images (BabelImages) of this BabelSynset.
Property is_key_concept True if the synset is a key concept.
Property languages The set of languages used in this Synset.
Property main_image The best image (BabelImage) of this BabelSynset.
Property pos The part of speech of this Synset.
Property qcode_ids The qcode identifier associated with this synset.
Property sense_sources The list of sense sources contained in the synset.
Property synset_degree The synset degree associated with this synset.
Property tags The tags of this synset
Property translations All translations between senses found in this BabelSynset.
Property type The kind of synset.
Property wordnet_offsets The WordNet offsets (version 3.0) whose corresponding synsets this BabelSynset covers, if any.
Method __eq__ Undocumented
Method __hash__ Undocumented
Method __iter__ Undocumented
Method __len__ Undocumented
Method __repr__ Undocumented
Method __str__ Undocumented
Method _get_examples Get the examples of the synset
Method _get_glosses Get the glosses of the synset
Method _load load method
Method _valid_degree The synset degree associated with this synset, or the number of outgoing edges if the synset degree is not available.
Instance Variable _contained_sense_sources true if contains the sense source
Instance Variable _domains the domains
Instance Variable _edges the edges
Instance Variable _examples the examples
Instance Variable _frame_id the frame id
Instance Variable _glosses the glosses
Instance Variable _images the images
Instance Variable _is_loaded true if the synset is loaded, false otherwise
Instance Variable _key_concept teh key concept
Instance Variable _main_image the main image
Instance Variable _main_senses the main sense
Instance Variable _qcode_ids the qcode ids
Instance Variable _senses the senses
Instance Variable _synset_degree the synset degree
Instance Variable _tags the tags
Instance Variable _target_langs target_langs
Instance Variable _translations the translations
Instance Variable _type the type of the synset
Instance Variable _wn_offsets the wordnet offset
def __init__(self, synset_id, target_langs):

init method

Parameters
synset_id:BabelSynsetIDthe BabelSynsetID
target_langs:Set[Language]the target languages
def categories(self, *languages):

Get the categories (BabelCategory) of this BabelSynset in the specified languages (if not specified, return all categories).

Parameters
*languages:LanguageThe search languages.
Returns
List[BabelCategory]The categories (BabelCategory) of this BabelSynset
def examples(self, language=None, source=None):

Collect all Examples for this Synset.

Parameters
language:Optional[Language]The example language (default None).
source:Optional[BabelSenseSource]The example source (default None).
Returns
List[BabelExample]the examples
def get_string_tags(self):

The tags of this synset as string

Returns
List[StringTag]the string tags
def glosses(self, language=None, source=None):

Collect all Glosses for this Synset.

Parameters
language:Optional[Language]The gloss language (default None).
source:Optional[BabelSenseSource]The gloss source (default None).
Returns
List[BabelGloss]A list of BabelGlosses.
def lemmas(self, language, *admitted_types):

Return the lemmas in this BabelSynset sorted by relevance and type.

Parameters
language:LanguageThe language of interest.
*admitted_types:BabelLemmaTypeThe types for the requested synset lemmas.
Returns
List[BabelLemma]The lemmas in the synset sorted by relevance and type.
def main_example(self, language=None):

Get the main Example for this Synset.

Parameters
language:Optional[Language]The example language (default None).
Returns
Optional[BabelExample]The main Example.
def main_gloss(self, language=None):

Get the main Gloss in the given language, if any.

Parameters
language:Optional[Language]The gloss language (default None).
Returns
Optional[BabelGloss]The main Gloss of the synset.
def main_sense(self, language=None):

Get the main BabelSense by importance of this BabelSynset.

Parameters
language:Optional[Language]The language of the the main sense (default None).
Returns
Optional[BabelSense]The main sense of this Babel synset.
def main_sense_preferably_in(self, language):

Get the main BabelSense by importance of this BabelSynset, preferrably in the given language.

Parameters
language:Optional[Language]The preferred language of the main sense.
Returns
Optional[BabelSense]The senses of this Babel synset in a specific language sorted by importance.
def main_senses(self, language):

Collect distinct BabelSenses sorted by importance to this BabelSynset for a given language.

Parameters
language:LanguageThe search language.
Returns
List[BabelSense]The senses of this Babel synset in a specific language sorted by importance.
def outgoing_edges(self, *relation_types):

Collect all Synset edges incident on this Synset.

Parameters
*relation_types:BabelPointerThe types of the edges connecting this synset to other synsets
Returns
List[BabelSynsetRelation]The SynsetRelations incident on this Synset
def retain_senses(self, *pred):

Retain all the senses which pass the predicate tests.

Parameters
*pred:Callable[[BabelSense], bool]The predicates used to decide whether to keep each sense in the synset.
Returns
boolTrue if at least one sense is left in the synset, False otherwise.
def senses(self, language=None, source=None):

Get the senses contained in this Synset.

Parameters
language:Optional[Language]The language used to search (default None).
source:Optional[BabelSenseSource]The source of the senses to be retrieved (default None).
Returns
List[BabelSense]The senses of this synset.
def senses_by_word(self, lemma, language, *sources, normalized=False):

Gets the Senses for the input word in the given language.

Parameters
lemma:strLemma of the sense.
language:LanguageLanguage of the sense.
*sources:BabelSenseSourcePossible sources for the sense.
normalized:Optional[bool]Use normalization? (default False)
Returns
List[BabelSense]The Senses for the input word in the given language.
def to_str(self, *languages):

Return the string representation of the BabelSenses of this BabelSynset only for a specific set of languages.

Parameters
*languages:LanguageThe languages to use for the string representation.
Returns
strA stringified representation of this Babel synset using only the senses in a specific set of languages.
def to_uris(self, resource, *languages):

Return the URIs of the various senses in the given languages in the synset for a given ExternalResource.

Parameters
resource:BabelExternalResourceThe external resource.
*languages:LanguageThe languages of interest.
Returns
List[str]The URIs to the external resource.
def wordnet_offset_map_from(self, from_version):

Obtain a map from WordNetSynsetID of the input WordNetVersion to the current version of WordNet (3.0 as of 2016).

Parameters
from_version:WordNetVersionThe source WordNet version.
Returns
Dict[WordNetSynsetID, List[WordNetSynsetID]]A map from WordNetSynsetID to list of WordNetSynsetID.
def wordnet_offset_map_to(self, to_version):

Obtain a map from the current version of WordNet (3.0 as of 2016) to WordNetSynsetIDs of the input WordNetVersion.

Parameters
to_version:WordNetVersionThe target WordNet version.
Returns
Dict[WordNetSynsetID, List[WordNetSynsetID]]A map from WordNetSynsetID to list of WordNetSynsetID.

The id of the synset.

@property
domains: Dict[BabelDomain, float] =

The BabelDomains of this BabelSynset.

@property
frame_id: Optional[FrameID] =

Return the FrameID associated with this synset.

The images (BabelImages) of this BabelSynset.

@property
is_key_concept: bool =

True if the synset is a key concept.

@property
languages: Set[Language] =

The set of languages used in this Synset.

@property
main_image: Optional[BabelImage] =

The best image (BabelImage) of this BabelSynset.

@property
pos: Set[Language] =

The part of speech of this Synset.

@property
qcode_ids: List[QcodeID] =

The qcode identifier associated with this synset.

@property
sense_sources: List[BabelSenseSource] =

The list of sense sources contained in the synset.

@property
@abstractmethod
synset_degree: int =

The synset degree associated with this synset.

The tags of this synset

All translations between senses found in this BabelSynset.

@property
type: SynsetType =

The kind of synset.

@property
wordnet_offsets: List[WordNetSynsetID] =

The WordNet offsets (version 3.0) whose corresponding synsets this BabelSynset covers, if any.

def __eq__(self, other):

Undocumented

def __hash__(self):

Undocumented

def __iter__(self):

Undocumented

def __len__(self):

Undocumented

def __repr__(self):

Undocumented

def __str__(self):

Undocumented

@abstractmethod
def _get_examples(self):

Get the examples of the synset

@abstractmethod
def _get_glosses(self):

Get the glosses of the synset

def _valid_degree(self):

The synset degree associated with this synset, or the number of outgoing edges if the synset degree is not available.

Returns
intthe synset degree of this synset
_contained_sense_sources =

true if contains the sense source

_domains =

the domains

_edges: list =

the edges

_examples =

the examples

_frame_id: Optional[FrameID] =

the frame id

_glosses =

the glosses

_images =

the images

_is_loaded: bool =

true if the synset is loaded, false otherwise

_key_concept: bool =

teh key concept

_main_image =

the main image

_main_senses: dict =

the main sense

_qcode_ids: Optional[List[QcodeID]] =

the qcode ids

_senses =

the senses

_synset_degree: Optional[int] =

the synset degree

_target_langs =

target_langs

_translations =

the translations

_type =

the type of the synset

_wn_offsets =

the wordnet offset