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

Method test_find_lexeme

test/test_it.py:108–118  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

106 print "pattern.it.inflect.verbs.find_lemma()"
107
108 def test_find_lexeme(self):
109 # Assert the accuracy of the verb conjugation algorithm.
110 i, n = 0, 0
111 for v, lexeme1 in it.inflect.verbs.infinitives.items():
112 lexeme2 = it.inflect.verbs.find_lexeme(v)
113 for j in range(len(lexeme2)):
114 if lexeme1[j] == lexeme2[j]:
115 i += 1
116 n += 1
117 self.assertTrue(float(i) / n > 0.89)
118 print "pattern.it.inflect.verbs.find_lexeme()"
119
120 def test_conjugate(self):
121 # Assert different tenses with different conjugations.

Callers

nothing calls this directly

Calls 3

lenFunction · 0.85
itemsMethod · 0.45
find_lexemeMethod · 0.45

Tested by

no test coverage detected