module documentation

An NLTK interface for WordNet

WordNet is a lexical database of English. Using synsets, helps find conceptual relationships between words such as hypernyms, hyponyms, synonyms, antonyms etc.

For details about WordNet see: http://wordnet.princeton.edu/

This module also allows you to find lemmas in languages other than English from the Open Multilingual Wordnet http://compling.hss.ntu.edu.sg/omw/

Class Lemma The lexical entry for a single morphological form of a sense-disambiguated word.
Class Synset Create a Synset from a "<lemma>.<pos>.<number>" string where: <lemma> is the word's morphological stem <pos> is one of the module attributes ADJ, ADJ_SAT, ADV, NOUN or VERB <number> is the sense number, counting from 0.
Exception WordNetError An exception class for wordnet-related errors.
Function information_content Undocumented
Function jcn_similarity Undocumented
Function lch_similarity Undocumented
Function lin_similarity Undocumented
Function path_similarity Undocumented
Function res_similarity Undocumented
Function wup_similarity Undocumented
Constant POS_LIST Undocumented
Constant SENSENUM_RE Undocumented
Constant VERB_FRAME_STRINGS Undocumented
Variable ADJ Undocumented
Variable ADJ_SAT Undocumented
Variable ADV Undocumented
Variable NOUN Undocumented
Variable VERB Undocumented
Class _WordNetObject A common base class for lemmas and synsets.
Function _get_pos Undocumented
Function _lcs_ic Get the information content of the least common subsumer that has the highest information content value. If two nodes have no explicit common subsumer, assume that they share an artificial root node that is the hypernym of all explicit roots.
Constant _INF Undocumented
def information_content(synset, ic): (source)

Undocumented

def jcn_similarity(synset1, synset2, ic, verbose=False): (source)

Undocumented

def lch_similarity(synset1, synset2, verbose=False, simulate_root=True): (source)

Undocumented

def lin_similarity(synset1, synset2, ic, verbose=False): (source)

Undocumented

def path_similarity(synset1, synset2, verbose=False, simulate_root=True): (source)

Undocumented

def res_similarity(synset1, synset2, ic, verbose=False): (source)

Undocumented

def wup_similarity(synset1, synset2, verbose=False, simulate_root=True): (source)

Undocumented

POS_LIST = (source)

Undocumented

Value
[NOUN, VERB, ADJ, ADV]
SENSENUM_RE = (source)

Undocumented

Value
re.compile(r'\.\d+\.')
VERB_FRAME_STRINGS: tuple = (source)

Undocumented

Value
(None,
 'Something %s',
 'Somebody %s',
 'It is %sing',
 'Something is %sing PP',
 'Something %s something Adjective/Noun',
 'Something %s Adjective/Noun',
...

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

def _get_pos(field): (source)

Undocumented

def _lcs_ic(synset1, synset2, ic, verbose=False): (source)

Get the information content of the least common subsumer that has the highest information content value. If two nodes have no explicit common subsumer, assume that they share an artificial root node that is the hypernym of all explicit roots.

speech as the first synset. :type ic: dict :param ic: an information content object (as returned by load_ic()). :return: The information content of the two synsets and their most informative subsumer

Parameters
synset1:SynsetFirst input synset.
synset2:SynsetSecond input synset. Must be the same part of
icUndocumented
verboseUndocumented
_INF: float = (source)

Undocumented

Value
1e+300