A set of synonyms that share a common meaning.
(self, synset=None, pos=NOUN)
| 112 | class 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 |