class documentation

class WordNetSense(BabelSense):

View In Hierarchy

A WordNet sense. Provides WordNet-specific methods.

Method __init__ init method
Instance Variable position The position of the WordNet sense to which this sense corresponds.
Instance Variable sense_number The sense number of the WordNet if any.
Instance Variable sensekey The sensekey of the OmegaWiki, Wikidata, Wiktionary, GeoName, MSTERM or VerbNet sense to which this sense corresponds, if any.
Instance Variable wordnet_offset The offset of the WordNet sense to which this sense corresponds, if any.
Property sense_str A String-based representation of this BabelSense alternative to the "canonical" one obtained using __str__. This corresponds to a diesis-like representation if the sense belongs to WordNet, e.g. 'car#n#1'...

Inherited from BabelSense:

Method synset.setter Set the synset the sense belongs to.
Method to_uri Return the URI of the sense for a given ExternalResource.
Instance Variable full_lemma The full lemma for this sense.
Instance Variable id The id of the sense in the SQL database.
Instance Variable language The language of this sense.
Instance Variable normalized_lemma The normalized lemma for this sense (lowercase, without parentheses, etc.).
Instance Variable pos The part-of-speech of this sense.
Instance Variable pronunciations The set of the audio pronunciations.
Instance Variable source The source of this lemma: WordNet, Wikipedia, translation, etc.
Instance Variable synset_id The synset id this sense belongs to.
Property is_automatic_translation True if the sense is the result of an automatic translation.
Property is_key_sense True if it is a key sense.
Property is_not_automatic_translation Returns True if the sense is NOT the result of an automatic translation.
Property lemma Get the lemma of this BabelSense
Property license The license for this Babel sense.
Property synset The synset the sense belongs to.
Method __eq__ Undocumented
Method __hash__ Undocumented
Method __repr__ Undocumented
Method __str__ Undocumented
Method _get_dbpedia_uri Get a link to the corresponding DBPedia URI (None if no interlinking is available or possible).
Method _get_geonames_uri Get a link to the corresponding GeoNames URI (None if no interlinking is available or possible).
Method _get_yago_uri Get a link to the corresponding YAGO URI (None if no interlinking is available or possible).
Constant _DBPEDIA_PREFIX The prefix of DBPedia URIs.
Constant _YAGO_PREFIX The prefix of YAGO3 URIs.
Instance Variable _key_sense The sensekey of the OmegaWiki, Wikidata, Wiktionary, GeoName, MSTERM or VerbNet sense to which this sense corresponds, if any.
Instance Variable _lemma the lemma
Instance Variable _synset The synset this sense belongs to.
Instance Variable _yago_url the yago url
def __init__(self, lemma, language, pos, source, sensekey, synset, *, wordnet_offset=None, wordnet_synset_position=None, wordnet_sense_number=None, **kwargs):

init method

Parameters
lemma:strThe full lemma for this sense.
language:LanguageThe language of this sense.
pos:POSThe part-of-speech of this sense.
source:BabelSenseSourceThe source of this lemma: WordNet, Wikipedia, translation, etc.
sensekey:strThe sensekey of the OmegaWiki, Wikidata, Wiktionary, GeoName, MSTERM or VerbNet sense to which this sense corresponds, if any.
synset:BabelSynsetThe synset this sense belongs to.
wordnet_offset:Optional[str]The offset of the WordNet sense to which this sense corresponds, if any (default None).
wordnet_synset_position:Optional[int]The position of the WordNet sense to which this sense corresponds (default None).
wordnet_sense_number:Optional[int]The sense number of the WordNet if any (default None).
**kwargsOptional parameters of BabelSense.
position: Optional[int] =

The position of the WordNet sense to which this sense corresponds.

sense_number: Optional[int] =

The sense number of the WordNet if any.

sensekey =

The sensekey of the OmegaWiki, Wikidata, Wiktionary, GeoName, MSTERM or VerbNet sense to which this sense corresponds, if any.

wordnet_offset: Optional[str] =

The offset of the WordNet sense to which this sense corresponds, if any.

@property
sense_str =

A String-based representation of this BabelSense alternative to the "canonical" one obtained using __str__. This corresponds to a diesis-like representation if the sense belongs to WordNet, e.g. 'car#n#1' or 'funk#n#3', or the page otherwise the lemma.

Returns
boolA string that represents this BabelSense