class documentation
class WordNetSynsetID(SynsetID):
A resource identifier with the specified WordNet synset id.
Examples of WordNetSynsetID:
rid = WordNetSynsetID('wn:06879521n')
Method | __init__ |
init method |
Method | to |
Obtain a list of WordNetSynsetIDs corresponding to this WordNetSynsetID in the input WordNetVersion. |
Instance Variable | version |
WordNet version. |
Instance Variable | version |
Cross-version mapping. |
Property | is |
True if the SynsetID is valid, False otherwise |
Method | _check_prefix_ |
check the prefix and return a babel sense source version |
Method | _check_prefix_ |
check the prefix and return a wordnet version |
Constant | _ID |
ID string length (int). |
Constant | _ID |
The WordNet offset prefix (str). |
Constant | _OEWN |
ID lenght for OEWN |
Constant | _OEWN |
The Open English WordNet offset prefix |
Constant | _WN2020 |
ID lenght for WN2020 |
Constant | _WN2020 |
The WordNet 2020 offset prefix |
Inherited from SynsetID
:
Instance Variable | pos |
the POS |
Property | simple |
The offset without prefix (e.g. `wn:` or `bn:`). |
Inherited from ResourceID
(via SynsetID
):
Method | to |
Convert the ID to a collection of BabelSynsets. |
Instance Variable | id |
ID of a ResourceID. |
Instance Variable | language |
Language of the resource ID, if available. |
Instance Variable | source |
Source of the resource ID. |
Method | __eq__ |
Undocumented |
Method | __hash__ |
Undocumented |
Method | __lt__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
overrides
babelnet.resources.SynsetID.__init__
init method
Parameters | |
idstr | The synset ID string. |
version:Optional[ | The WordNet version (default WordNetVersion.WN_30). |
mapping:Optional[ | Cross-version mapping (default None). |
Raises | |
InvalidSynsetIDError | Raised if the synset ID is invalid. |
def to_version(self, target_version):
Obtain a list of WordNetSynsetIDs corresponding to this WordNetSynsetID in the input WordNetVersion.
Parameters | |
targetWordNetVersion | The target version to convert to. |
Returns | |
List[ | Corresponding IDs. |
overrides
babelnet.resources.SynsetID.is_valid
True if the SynsetID is valid, False otherwise
Returns | |
bool | True or False |
def _check_prefix_BS(self, prefix):
check the prefix and return a babel sense source version
Parameters | |
prefix:str | the prefix to check |
Returns | |
BabelSenseSource | a BabelSenseSource |
def _check_prefix_WN(self, prefix):
check the prefix and return a wordnet version
Parameters | |
prefix:str | the prefix to check |
Returns | |
WordNetVersion | a WordNetVersion |