MCPcopy Index your code
hub / github.com/clips/pattern / hypernym

Method hypernym

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

Yields the synset that is the semantic parent, for example: synsets("train")[0].hypernym => Synset("public transport").

(self)

Source from the content-addressed store, hash-verified

243
244 @property
245 def hypernym(self):
246 """ Yields the synset that is the semantic parent, for example:
247 synsets("train")[0].hypernym => Synset("public transport").
248 """
249 p = self._synset.getPointers(wn.HYPERNYM)
250 return len(p) > 0 and Synset(p[0].getTarget()) or None
251
252 def similar(self):
253 """ Returns a list of similar synsets for adjectives and adverbs, 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