Beispiel #1
0
 def test_cosine_empty_1(self):
     self.assertEqual(cosine("",""), 0.0)
Beispiel #2
0
def cosine_sim(source_terms, target_terms, *args):
    return sim.cosine(source_terms, target_terms)
Beispiel #3
0
 def test_cosine_symmetry(self):
     self.assertEqual(cosine("ab","bc"), cosine("bc","ab"))
Beispiel #4
0
 def test_cosine_1(self):
     self.assertAlmostEqual(cosine("levenshtein","leuwenhstijn"), 0.609, 3)
Beispiel #5
0
 def test_cosine_identity(self):
     self.assertEqual(cosine("a","a"), 1.0)
Beispiel #6
0
 def test_cosine_empty_1(self):
     self.assertEqual(cosine("", ""), 0.0)
Beispiel #7
0
 def test_cosine_1(self):
     self.assertAlmostEqual(cosine("levenshtein", "leuwenhstijn"), 0.609, 3)
Beispiel #8
0
 def test_cosine_symmetry(self):
     self.assertEqual(cosine("ab", "bc"), cosine("bc", "ab"))
Beispiel #9
0
 def test_cosine_identity(self):
     self.assertEqual(cosine("a", "a"), 1.0)