Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pattern/text/en/en-lexicon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ $25 CD
17 CD
17th CD
1st JJ
2 IN
2 CD
20 CD
2008 CD
2010 CD
Expand All @@ -443,7 +443,7 @@ $25 CD
3 CD
30 CD
31 CD
4 IN
4 CD
40 CD
48 CD
4th CD
Expand Down
10 changes: 10 additions & 0 deletions test/test_en.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,16 @@ def test_parsetree(self):
self.assertTrue(isinstance(v, en.Text))
print("pattern.en.parsetree()")

def test_parsetree_cardinal_number(self):
""" Test that it correctly identified numbers as Cardinal Numbers
"""
for test_num in xrange(0, 10):
test_num = str(test_num)
v = en.parsetree("I am %s years old" % test_num)
found_num = v.words[2]
self.assertEquals(found_num.type, 'CD')
self.assertEquals(found_num.string, test_num)

def test_split(self):
# Assert split(parse(s)) == Text.
v = en.split(en.parse("The cat purs."))
Expand Down