Exemplo n.º 1
0
 def test_two_words_within_long_whitespace(self):
     self.assertEqual(moracle.split_string('   word1  word2  '),
                      [('word1', 3, 7), ('word2', 10, 14)])
Exemplo n.º 2
0
 def test_three_words(self):
     self.assertEqual(moracle.split_string('word1 word2 word3'),
                      [('word1', 0, 4), ('word2', 6, 10),
                       ('word3', 12, 16)])
Exemplo n.º 3
0
 def test_word_within_long_whitespace(self):
     self.assertEqual(moracle.split_string('  word   '), [('word', 2, 5)])
Exemplo n.º 4
0
 def test_two_words(self):
     self.assertEqual(moracle.split_string('word1 word2'),
                      [('word1', 0, 4), ('word2', 6, 10)])
Exemplo n.º 5
0
 def test_word_with_trailing_whitespace(self):
     self.assertEqual(moracle.split_string('word '), [('word', 0, 3)])
Exemplo n.º 6
0
 def test_word_with_leading_whitespace(self):
     self.assertEqual(moracle.split_string(' word'), [('word', 1, 4)])
Exemplo n.º 7
0
 def test_one_word(self):
     self.assertEqual(moracle.split_string('word'), [('word', 0, 3)])
Exemplo n.º 8
0
 def test_whitespace(self):
     self.assertEqual(moracle.split_string(' '), [])
Exemplo n.º 9
0
 def test_empty_string(self):
     self.assertEqual(moracle.split_string(''), [])