def test_dice_1(self): self.assertAlmostEqual(dice("levenshtein","leuwenhstijn"), 0.609, 3)
def dice_sim(source_terms, target_terms, *args): return sim.dice(source_terms, target_terms)
def test_dice_identity(self): self.assertEqual(dice("a","a"), 1.0)
def test_dice_symmetry(self): self.assertEqual(dice("ab","bc"), dice("bc","ab"))
def test_dice_empty_2(self): self.assertEqual(dice("a",""), 0.0)
def test_dice_empty_3(self): self.assertEqual(dice("","a"), 0.0)
def test_dice_1(self): self.assertAlmostEqual(dice("levenshtein", "leuwenhstijn"), 0.609, 3)
def test_dice_symmetry(self): self.assertEqual(dice("ab", "bc"), dice("bc", "ab"))
def test_dice_identity(self): self.assertEqual(dice("a", "a"), 1.0)
def test_dice_empty_3(self): self.assertEqual(dice("", "a"), 0.0)
def test_dice_empty_2(self): self.assertEqual(dice("a", ""), 0.0)