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