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

Method antonym

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

Yields the semantically opposite synset, for example: synsets("death")[0].antonym => Synset("birth").

(self)

Source from the content-addressed store, hash-verified

177
178 @property
179 def antonym(self):
180 """ Yields the semantically opposite synset, for example:
181 synsets("death")[0].antonym => Synset("birth").
182 """
183 p = self._synset.getPointers(wn.ANTONYM)
184 return len(p) > 0 and Synset(p[0].getTarget()) or None
185
186 def meronyms(self):
187 """ Yields a list of synsets that are semantic members/parts of this synset, for example:

Callers

nothing calls this directly

Calls 4

lenFunction · 0.85
getTargetMethod · 0.80
SynsetClass · 0.70
getPointersMethod · 0.45

Tested by

no test coverage detected