class BabelSynset(ABC):
Known subclasses: babelnet.synset._OfflineBabelSynset
, babelnet.synset._OnlineBabelSynset
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 |
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 |
Get the main Example for this Synset. |
Method | main |
Get the main Gloss in the given language, if any. |
Method | main |
Get the main BabelSense by importance of this BabelSynset. |
Method | main |
Get the main BabelSense by importance of this BabelSynset, preferrably in the given language. |
Method | main |
Collect distinct BabelSenses sorted by importance to this BabelSynset for a given language. |
Method | outgoing |
Collect all Synset edges incident on this Synset. |
Method | retain |
Retain all the senses which pass the predicate tests. |
Method | senses |
Get the senses contained in this Synset. |
Method | senses |
Gets the Senses for the input word in the given language. |
Method | to |
Return the string representation of the BabelSenses of this BabelSynset only for a specific set of languages. |
Method | to |
Return the URIs of the various senses in the given languages in the synset for a given ExternalResource. |
Method | wordnet |
Obtain a map from WordNetSynsetID of the input WordNetVersion to the current version of WordNet (3.0 as of 2016). |
Method | wordnet |
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 |
Return the FrameID associated with this synset. |
Property | images |
The images (BabelImages) of this BabelSynset. |
Property | is |
True if the synset is a key concept. |
Property | languages |
The set of languages used in this Synset. |
Property | main |
The best image (BabelImage) of this BabelSynset. |
Property | pos |
The part of speech of this Synset. |
Property | qcode |
The qcode identifier associated with this synset. |
Property | sense |
The list of sense sources contained in the synset. |
Property | synset |
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 |
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 |
Get the examples of the synset |
Method | _get |
Get the glosses of the synset |
Method | _load |
load method |
Method | _valid |
The synset degree associated with this synset, or the number of outgoing edges if the synset degree is not available. |
Instance Variable | _contained |
true if contains the sense source |
Instance Variable | _domains |
the domains |
Instance Variable | _edges |
the edges |
Instance Variable | _examples |
the examples |
Instance Variable | _frame |
the frame id |
Instance Variable | _glosses |
the glosses |
Instance Variable | _images |
the images |
Instance Variable | _is |
true if the synset is loaded, false otherwise |
Instance Variable | _key |
teh key concept |
Instance Variable | _main |
the main image |
Instance Variable | _main |
the main sense |
Instance Variable | _qcode |
the qcode ids |
Instance Variable | _senses |
the senses |
Instance Variable | _synset |
the synset degree |
Instance Variable | _tags |
the tags |
Instance Variable | _target |
target_langs |
Instance Variable | _translations |
the translations |
Instance Variable | _type |
the type of the synset |
Instance Variable | _wn |
the wordnet offset |
init method
Parameters | |
synsetBabelSynsetID | the BabelSynsetID |
targetSet[ | the target languages |
Get the categories (BabelCategory) of this BabelSynset in the specified languages (if not specified, return all categories).
Parameters | |
*languages:Language | The search languages. |
Returns | |
List[BabelCategory] | The categories (BabelCategory) of this BabelSynset |
Collect all Examples for this Synset.
Parameters | |
language:Optional[ | The example language (default None). |
source:Optional[ | The example source (default None). |
Returns | |
List[ | the examples |
Collect all Glosses for this Synset.
Parameters | |
language:Optional[ | The gloss language (default None). |
source:Optional[ | The gloss source (default None). |
Returns | |
List[ | A list of BabelGlosses. |
Return the lemmas in this BabelSynset sorted by relevance and type.
Parameters | |
language:Language | The language of interest. |
*admittedBabelLemmaType | The types for the requested synset lemmas. |
Returns | |
List[ | The lemmas in the synset sorted by relevance and type. |
Get the main Example for this Synset.
Parameters | |
language:Optional[ | The example language (default None). |
Returns | |
Optional[ | The main Example. |
Get the main Gloss in the given language, if any.
Parameters | |
language:Optional[ | The gloss language (default None). |
Returns | |
Optional[ | The main Gloss of the synset. |
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. |
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. |
Collect distinct BabelSenses sorted by importance to this BabelSynset for a given language.
Parameters | |
language:Language | The search language. |
Returns | |
List[BabelSense] | The senses of this Babel synset in a specific language sorted by importance. |
Collect all Synset edges incident on this Synset.
Parameters | |
*relationBabelPointer | The types of the edges connecting this synset to other synsets |
Returns | |
List[ | The SynsetRelations incident on this Synset |
Retain all the senses which pass the predicate tests.
Parameters | |
*pred:Callable[ | The predicates used to decide whether to keep each sense in the synset. |
Returns | |
bool | True if at least one sense is left in the synset, False otherwise. |
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. |
Gets the Senses for the input word in the given language.
Parameters | |
lemma:str | Lemma of the sense. |
language:Language | Language of the sense. |
*sources:BabelSenseSource | Possible sources for the sense. |
normalized:Optional[bool] | Use normalization? (default False) |
Returns | |
List[BabelSense] | The Senses for the input word in the given language. |
Return the string representation of the BabelSenses of this BabelSynset only for a specific set of languages.
Parameters | |
*languages:Language | The languages to use for the string representation. |
Returns | |
str | A stringified representation of this Babel synset using only the senses in a specific set of languages. |
Return the URIs of the various senses in the given languages in the synset for a given ExternalResource.
Parameters | |
resource:BabelExternalResource | The external resource. |
*languages:Language | The languages of interest. |
Returns | |
List[str] | The URIs to the external resource. |
Obtain a map from WordNetSynsetID of the input WordNetVersion to the current version of WordNet (3.0 as of 2016).
Parameters | |
fromWordNetVersion | The source WordNet version. |
Returns | |
Dict[ | A map from WordNetSynsetID to list of WordNetSynsetID. |
Obtain a map from the current version of WordNet (3.0 as of 2016) to WordNetSynsetIDs of the input WordNetVersion.
Parameters | |
toWordNetVersion | The target WordNet version. |
Returns | |
Dict[ | A map from WordNetSynsetID to list of WordNetSynsetID. |
The synset degree associated with this synset, or the number of outgoing edges if the synset degree is not available.
Returns | |
int | the synset degree of this synset |
bool
=
babelnet.synset._OnlineBabelSynset
true if the synset is loaded, false otherwise