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

Method lexeme

pattern/text/__init__.py:1384–1394  ·  view source on GitHub ↗

Returns a list of all possible inflections of the given verb.

(self, verb, parse=True)

Source from the content-addressed store, hash-verified

1382 return self.find_lemma(verb)
1383
1384 def lexeme(self, verb, parse=True):
1385 """ Returns a list of all possible inflections of the given verb.
1386 """
1387 a = []
1388 b = self.lemma(verb, parse=parse)
1389 if b in self:
1390 a = [x for x in self[b] if x != ""]
1391 elif parse is True: # rule-based
1392 a = self.find_lexeme(b)
1393 u = []; [u.append(x) for x in a if x not in u]
1394 return u
1395
1396 def conjugate(self, verb, *args, **kwargs):
1397 """ Inflects the verb and returns the given tense (or None).

Callers 6

test_lexemeMethod · 0.80
test_lexemeMethod · 0.80
test_lexemeMethod · 0.80
test_lexemeMethod · 0.80
test_lexemeMethod · 0.80
test_lexemeMethod · 0.80

Calls 3

lemmaMethod · 0.95
find_lexemeMethod · 0.95
appendMethod · 0.45

Tested by 6

test_lexemeMethod · 0.64
test_lexemeMethod · 0.64
test_lexemeMethod · 0.64
test_lexemeMethod · 0.64
test_lexemeMethod · 0.64
test_lexemeMethod · 0.64