コード例 #1
0
ファイル: TestWordQuantities.py プロジェクト: ririw/lawyered
 def test_words(self):
     v = WordTypeQuantities.GeneralizingTermsCheck()
     cases = {
         """Was anybody else there? asked Mr. Pumblechook.""":
         1,
         """Yes, said I. Estella waved a blue flag, and I waved a red one, and Miss Havisham waved one sprinkled all over with little gold stars, out at the coach-window. And then we all waved our swords and hurrahed.""":
         2
     }
     for (words, count) in cases.items():
         d = Data(words, True)
         assert (v.build(d) == count)
         d = Data(words, False)
         assert (v.build(d) == count)
コード例 #2
0
ファイル: TestWordQuantities.py プロジェクト: ririw/lawyered
 def test_empty(self):
     v = WordTypeQuantities.GeneralizingTermsCheck()
     d = Data("", True)
     assert (v.build(d) == 0)
     d = Data("", False)
     assert (v.build(d) == 0)