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

Method test_singularize

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

Source from the content-addressed store, hash-verified

53 print "pattern.en.inflect.pluralize()"
54
55 def test_singularize(self):
56 # Assert the accuracy of the singularization algorithm.
57 from pattern.db import Datasheet
58 i, n = 0, 0
59 for sg, pl in Datasheet.load(os.path.join(PATH, "corpora", "wordforms-en-celex.csv")):
60 if en.inflect.singularize(pl) == sg:
61 i +=1
62 n += 1
63 self.assertTrue(float(i) / n > 0.95)
64 print "pattern.en.inflect.singularize()"
65
66 def test_find_lemma(self):
67 # Assert the accuracy of the verb lemmatization algorithm.

Callers

nothing calls this directly

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected