MCPcopy Create free account
hub / github.com/clips/pattern / __init__

Method __init__

pattern/text/en/wordnet/__init__.py:114–121  ·  view source on GitHub ↗

A set of synonyms that share a common meaning.

(self, synset=None, pos=NOUN)

Source from the content-addressed store, hash-verified

112class Synset(object):
113
114 def __init__(self, synset=None, pos=NOUN):
115 """ A set of synonyms that share a common meaning.
116 """
117 if isinstance(synset, int):
118 synset = wn.getSynset({NN: "n", VB: "v", JJ: "adj", RB: "adv"}[pos], synset)
119 if isinstance(synset, basestring):
120 synset = synsets(synset, pos)[0]._synset
121 self._synset = synset
122
123 def __iter__(self):
124 for s in self._synset.getSenses(): yield s.form

Callers 1

__init__Method · 0.45

Calls 2

synsetsFunction · 0.85
getSynsetMethod · 0.80

Tested by

no test coverage detected