Example #1
0
 def test_two_words_with_pos_after_second_word(self):
     self.assertEqual(moracle.cursor_word(self.two_words, 15), 1)
Example #2
0
 def test_two_words_with_pos_after_first_word(self):
     self.assertEqual(moracle.cursor_word(self.two_words, 7), 0)
Example #3
0
 def test_two_words_with_pos_before_second_word(self):
     self.assertEqual(moracle.cursor_word(self.two_words, 8), 0)
Example #4
0
 def test_one_word_at_zero_with_pos_after_word(self):
     self.assertEqual(moracle.cursor_word([('word', 0, 4)], 5), 0)
Example #5
0
 def test_two_words_with_pos_before_first_word(self):
     self.assertEqual(moracle.cursor_word(self.two_words, 0), -1)
Example #6
0
 def test_one_word_at_nonzero_with_nonzero_hit_pos(self):
     self.assertEqual(moracle.cursor_word([('word', 3, 7)], 3), 0)
Example #7
0
 def test_one_word_at_nonzero_with_nonzero_miss_pos(self):
     self.assertEqual(moracle.cursor_word([('word', 3, 7)], 2), -1)
Example #8
0
 def test_one_word_at_zero_with_nonzero_pos(self):
     self.assertEqual(moracle.cursor_word([('word', 0, 4)], 2), 0)
Example #9
0
 def test_no_words_nonzero_pos(self):
     self.assertEqual(moracle.cursor_word([], 3), -1)
Example #10
0
 def test_no_words(self):
     self.assertEqual(moracle.cursor_word([], 0), -1)