| 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. |