Пример #1
0
 def test_split_sentences_trailing(self):
     self.assertEquals(lipsum._split_sentences("Hello. Hi. Hello"), 
             ["Hello", "Hi", "Hello"])
     self.assertEquals(lipsum._split_sentences("  Hello. Hi. Hello  "), 
             ["Hello", "Hi", "Hello"])
     self.assertEquals(lipsum._split_sentences("..  Hello... Hi.... Hello  "), 
             ["Hello", "Hi", "Hello"])
Пример #2
0
 def test_split_sentences(self):
     self.assertEquals(lipsum._split_sentences("Hello. Hi."), ["Hello", "Hi"])
     self.assertEquals(lipsum._split_sentences(self.sample), 
             ["One two three four five six", 
                 "Seven eight nine ten eleven twelve", 
                 "Thirteen fourteen fifteen sixteen", 
                 "Seventeen eighteen nineteen twenty"])
Пример #3
0
 def test_split_sentences_empty(self):
     self.assertEquals(lipsum._split_sentences(""), [])