예제 #1
0
 def test_damerau_levenshtein_transposition(self):
     self.assertEqual(1, _helpers._damerau_levenshtein('kitten', 'ktiten'))
예제 #2
0
 def test_damerau_levenshtein_empty(self):
     self.assertEqual(5, _helpers._damerau_levenshtein('', 'kites'))
     self.assertEqual(6, _helpers._damerau_levenshtein('kitten', ''))
예제 #3
0
 def test_damerau_levenshtein_commutative(self):
     self.assertEqual(2, _helpers._damerau_levenshtein('kitten', 'kites'))
     self.assertEqual(2, _helpers._damerau_levenshtein('kites', 'kitten'))
예제 #4
0
 def test_damerau_levenshtein_id(self):
     self.assertEqual(0, _helpers._damerau_levenshtein('asdf', 'asdf'))