示例#1
0
 def test_overlap_1(self):
     self.assertAlmostEqual(overlap("levenshtein","leuwenhstijn"), 0.636, 3)
示例#2
0
 def test_overlap_identity(self):
     self.assertEqual(overlap("a","a"), 1.0)
示例#3
0
 def test_overlap_symmetry(self):
     self.assertEqual(overlap("ab","bc"), overlap("bc","ab"))
示例#4
0
 def test_overlap_empty_2(self):
     self.assertEqual(overlap("a",""), 0.0)
示例#5
0
 def test_overlap_empty_3(self):
     self.assertEqual(overlap("","a"), 0.0)
示例#6
0
 def test_overlap_1(self):
     self.assertAlmostEqual(overlap("levenshtein", "leuwenhstijn"), 0.636,
                            3)
示例#7
0
 def test_overlap_symmetry(self):
     self.assertEqual(overlap("ab", "bc"), overlap("bc", "ab"))
示例#8
0
 def test_overlap_identity(self):
     self.assertEqual(overlap("a", "a"), 1.0)
示例#9
0
 def test_overlap_empty_3(self):
     self.assertEqual(overlap("", "a"), 0.0)
示例#10
0
 def test_overlap_empty_2(self):
     self.assertEqual(overlap("a", ""), 0.0)