Ejemplo n.º 1
0
 def testRegularCases(self):
     self.assertEqual(strings.levenshtein_distance('islander', 'slander'), 1)
     self.assertEqual(strings.levenshtein_distance('sunday', 'saturday'), 3)
     self.assertEqual(strings.levenshtein_distance('amanaplanacanalpanama',
         'docnoteidissentafastneverpreventsafatnessidietoncod'), 42)
Ejemplo n.º 2
0
 def testEmpty(self):
     self.assertEqual(strings.levenshtein_distance('', ''), 0)
     self.assertEqual(strings.levenshtein_distance('asdf', ''), 4)
     self.assertEqual(strings.levenshtein_distance('', 'asdf'), 4)