示例#1
0
文件: cltk.py 项目: thePortus/dhelp
    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)
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 def compare_minhash(self, other_text):
     return minhash(self.data, other_text)