Esempio n. 1
0
 def test_count(self):
     hist_dict = Dictogram(self.text_list)
     assert hist_dict.types == 5
     assert hist_dict.tokens == 8
     assert hist_dict.count('one') == 1
     assert hist_dict.count('two') == 1
     assert hist_dict.count('red') == 1
     assert hist_dict.count('blue') == 1
     assert hist_dict.count('fish') == 4
     assert hist_dict.count('food') == 0
Esempio n. 2
0
 def test_update(self):
     hist_dict = Dictogram(self.text_list)
     hist_dict.update(['two', 'blue', 'fish', 'food'])
     assert hist_dict.types == 6
     assert hist_dict.tokens == 12
     assert hist_dict.count('one') == 1
     assert hist_dict.count('two') == 2
     assert hist_dict.count('red') == 1
     assert hist_dict.count('blue') == 2
     assert hist_dict.count('fish') == 5
     assert hist_dict.count('food') == 1