Example #1
0
    def test_sentence_1(self):

        test_sentence = "Hello, Jack. How is it going? Not bad; pretty good, actually... Very very good, in fact."
        results = a6.get_sentence_lists(test_sentence)
    
        answer = [['hello', 'jack'], ['how', 'is', 'it', 'going'], ['not', 'bad', 'pretty', 'good', 'actually'], ['very', 'very', 'good', 'in', 'fact']]
        self.assertEqual(answer, results)
Example #2
0
 def test_sentence_removes_all_punctuations(self):
     test_sentence = "Hello( there, this{ }is_ a; test.  Hope; it: works% for* you."
     results = a6.get_sentence_lists(test_sentence)
     answer = [['hello', 'there', 'this', 'is', 'a', 'test'], ["hope", "it", "works", "for", "you"]]
     self.assertEqual(answer, results)
Example #3
0
 def test_sentence_has_line_feeds(self):
     test_sentence = "Hello there\nthis is a test."
     results = a6.get_sentence_lists(test_sentence)
     answer = [['hello', 'there', 'this', 'is', 'a', 'test']]
     self.assertEqual(answer, results)
Example #4
0
    def test_sentence_double_spaces(self):

        test_sentence = "Hello there?   this    is    a     test."
        results = a6.get_sentence_lists(test_sentence)
        answer = [['hello', 'there'], ['this', 'is', 'a', 'test']]
        self.assertEqual(answer, results)
Example #5
0
    def test_sentence(self):

        test_sentence = "a quick test"
        results = a6.get_sentence_lists(test_sentence)
        self.assertEqual([["a", "quick", "test"]], results)