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

Method test_pluralize

test/test_nl.py:20–31  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

18 pass
19
20 def test_pluralize(self):
21 # Assert "auto's" as plural of "auto".
22 self.assertEqual("auto's", nl.inflect.pluralize("auto"))
23 # Assert the accuracy of the pluralization algorithm.
24 from pattern.db import Datasheet
25 i, n = 0, 0
26 for pred, attr, sg, pl in Datasheet.load(os.path.join(PATH, "corpora", "wordforms-nl-celex.csv")):
27 if nl.pluralize(sg) == pl:
28 i +=1
29 n += 1
30 self.assertTrue(float(i) / n > 0.74)
31 print "pattern.nl.pluralize()"
32
33 def test_singularize(self):
34 # Assert the accuracy of the singularization algorithm.

Callers

nothing calls this directly

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected