def compare_minhash(self, other_text): """Gives the minimum hash between this and any passed text. Args: other_text (:obj:`str`) String for comparison Returns: :obj:`float` Minimum hash between texts Example: >>> text = LatinText('Gallia est omnis divisa in partes tres') >>> print(text.compare_minhash('Galliae sunt omnis divisae in partes tres')) 0.6444444444444445 """ # noqa from cltk.text_reuse.comparison import minhash return minhash(self.data, other_text)
def test_minhash(self): """Test for finding the similarity between two sentences using Minhash""" score = minhash(demo_verg, demo_prop) self.assertEqual(score, 0.17163120567375886)
def compare_minhash(self, other_text): return minhash(self.data, other_text)