Ejemplo n.º 1
0
 def test_words(self):
     v = WordTypeQuantities.SensoryRatioCheck()
     cases = {
         """And the mere sight of the torment, with his fishy eyes and mouth open, his sandy hair inquisitively on end, and his waistcoat heaving with windy arithmetic, made me vicious in my reticence.""":
         1,
         """The house was dark and shabby, and the greasy shoulders that had left their mark in Mr. Jaggers's room seemed to have been shuffling up and down the staircase for years.""":
         1,
         """Much of that! said he, glancing about him over the cold wet flat. I wish I was a frog. Or a eel!""":
         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)
Ejemplo n.º 2
0
 def test_empty(self):
     v = WordTypeQuantities.SensoryRatioCheck()
     d = Data("", True)
     assert (v.build(d) == 0)
     d = Data("", False)
     assert (v.build(d) == 0)