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