Exemple #1
0
 def test_case_4(self):
     expected = [["over", "3"], ["and", "3"], ["i", "2"], ["have", "1"],
                 ["failed", "1"], ["again", "1"], ["in", "1"], ["my", "1"],
                 ["life", "1"], ["that", "1"], ["is", "1"], ["why", "1"],
                 ["succeed", "1"]]
     result = wc.word_count_engine(self.example4)
     self.assertEqual(expected, result)
Exemple #2
0
 def test_case_6(self):
     expected = [["slim", "3"], ["shady", "3"], ["please", "3"],
                 ["stand", "3"], ["up", "3"], ["im", "2"], ["the", "2"],
                 ["real", "2"], ["cause", "1"], ["yes", "1"], ["all", "1"],
                 ["you", "1"], ["other", "1"], ["shadys",
                                                "1"], ["are", "1"],
                 ["just", "1"], ["imitating", "1"], ["so", "1"],
                 ["wont", "1"]]
     result = wc.word_count_engine(self.example6)
     self.assertEqual(expected, result)
Exemple #3
0
 def test_case_5(self):
     expected = [["you", "3"], ["one", "3"], ["or", "2"], ["it", "2"],
                 ["look", "1"], ["if", "1"], ["had", "1"], ["shot", "1"],
                 ["opportunity", "1"], ["to", "1"], ["seize", "1"],
                 ["everything", "1"], ["ever", "1"], ["wanted", "1"],
                 ["in", "1"], ["moment", "1"], ["would", "1"],
                 ["capture", "1"], ["just", "1"], ["let", "1"],
                 ["slip", "1"]]
     result = wc.word_count_engine(self.example5)
     self.assertEqual(expected, result)
Exemple #4
0
 def test_case_3(self):
     expected = [["and", "4"], ["every", "3"], ["is", "3"], ["a", "3"],
                 ["quotation", "3"], ["all", "2"], ["book", "1"],
                 ["house", "1"], ["out", "1"], ["of",
                                                "1"], ["forests", "1"],
                 ["mines", "1"], ["stone", "1"], ["quarries", "1"],
                 ["man", "1"], ["from", "1"], ["his", "1"],
                 ["ancestors", "1"]]
     result = wc.word_count_engine(self.example3)
     self.assertEqual(expected, result)
Exemple #5
0
 def test_case_2(self):
     expected = [["to", "2"], ["be", "2"], ["or", "1"], ["not", "1"],
                 ["that", "1"], ["is", "1"], ["the", "1"],
                 ["question", "1"]]
     result = wc.word_count_engine(self.example2)
     self.assertEqual(expected, result)
Exemple #6
0
 def test_case_1(self):
     expected = [["just", "4"], ["practice", "3"], ["perfect", "2"],
                 ["makes", "1"], ["youll", "1"], ["get", "1"], ["by", "1"]]
     result = wc.word_count_engine(self.example1)
     self.assertEqual(expected, result)