From b38141730d297bd48fddf3951f9eea4bda8d9f2b Mon Sep 17 00:00:00 2001 From: Milton Mazzarri Date: Thu, 30 Nov 2017 10:29:21 -0600 Subject: [PATCH] Fix unit tests for Spelling Corrector --- py/spell.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/py/spell.py b/py/spell.py index 5329b13..ac37b9b 100644 --- a/py/spell.py +++ b/py/spell.py @@ -58,20 +58,20 @@ def unit_tests(): assert words('This is a TEST.') == ['this', 'is', 'a', 'test'] assert Counter(words('This is a test. 123; A TEST this is.')) == ( Counter({'123': 1, 'a': 2, 'is': 2, 'test': 2, 'this': 2})) - assert len(WORDS) == 32192 - assert sum(WORDS.values()) == 1115504 + assert len(WORDS) == 32198 + assert sum(WORDS.values()) == 1115585 assert WORDS.most_common(10) == [ - ('the', 79808), + ('the', 79809), ('of', 40024), - ('and', 38311), + ('and', 38312), ('to', 28765), - ('in', 22020), + ('in', 22023), ('a', 21124), ('that', 12512), ('he', 12401), ('was', 11410), ('it', 10681)] - assert WORDS['the'] == 79808 + assert WORDS['the'] == 79809 assert P('quintessential') == 0 assert 0.07 < P('the') < 0.08 return 'unit_tests pass'