Example #1
0
 def testDamerauLevenshteinTransposition(self):
   self.assertEqual(1, _helpers._DamerauLevenshtein('kitten', 'ktiten'))
Example #2
0
 def testDamerauLevenshteinEmpty(self):
   self.assertEqual(5, _helpers._DamerauLevenshtein('', 'kites'))
   self.assertEqual(6, _helpers._DamerauLevenshtein('kitten', ''))
Example #3
0
 def testDamerauLevenshteinCommutative(self):
   self.assertEqual(2, _helpers._DamerauLevenshtein('kitten', 'kites'))
   self.assertEqual(2, _helpers._DamerauLevenshtein('kites', 'kitten'))
Example #4
0
 def testDamerauLevenshteinId(self):
   self.assertEqual(0, _helpers._DamerauLevenshtein('asdf', 'asdf'))