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

Method test_find_lemma

test/test_en.py:66–76  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

64 print "pattern.en.inflect.singularize()"
65
66 def test_find_lemma(self):
67 # Assert the accuracy of the verb lemmatization algorithm.
68 # Note: the accuracy is higher (95%) when measured on CELEX word forms
69 # (probably because en.verbs has high percentage irregular verbs).
70 i, n = 0, 0
71 for v1, v2 in en.inflect.verbs.inflections.items():
72 if en.inflect.verbs.find_lemma(v1) == v2:
73 i += 1
74 n += 1
75 self.assertTrue(float(i) / n > 0.90)
76 print "pattern.en.inflect.verbs.find_lemma()"
77
78 def test_find_lexeme(self):
79 # Assert the accuracy of the verb conjugation algorithm.

Callers

nothing calls this directly

Calls 2

itemsMethod · 0.45
find_lemmaMethod · 0.45

Tested by

no test coverage detected