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

Method test_singularize

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

Source from the content-addressed store, hash-verified

31 print "pattern.nl.pluralize()"
32
33 def test_singularize(self):
34 # Assert the accuracy of the singularization algorithm.
35 from pattern.db import Datasheet
36 i, n = 0, 0
37 for pred, attr, sg, pl in Datasheet.load(os.path.join(PATH, "corpora", "wordforms-nl-celex.csv")):
38 if nl.singularize(pl) == sg:
39 i +=1
40 n += 1
41 self.assertTrue(float(i) / n > 0.88)
42 print "pattern.nl.singularize()"
43
44 def test_attributive(self):
45 # Assert the accuracy of the attributive algorithm ("fel" => "felle").

Callers

nothing calls this directly

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected