Beispiel #1
0
    def compare_longest_common_substring(self, other_text):
        """Gives the longest excerpt that this and any passed text have in common.

        Args:
            other_text (:obj:`str`) String for comparison

        Returns:
            :obj:`str` Longest common substring

        Example:
            >>> text = LatinText('Gallia est omnis divisa in partes tres')
            >>> print(text.compare_longest_common_substring('Galliae sunt omnis divisae in partes tres'))
            in partes tres
        """ # noqa
        from cltk.text_reuse.comparison import long_substring
        return long_substring(self.data, other_text)
Beispiel #2
0
 def test_long_substring(self):
     """Test to check for the longest substring in the two passages"""
     substring = long_substring(demo_verg, demo_prop)
     self.assertEqual(substring, "dique deaeque omnes,")
Beispiel #3
0
 def test_long_substring(self):
     """Test to check for the longest substring in the two passages"""
     substring = long_substring(demo_verg, demo_prop)
     self.assertEqual(substring,"dique deaeque omnes,")
Beispiel #4
0
 def compare_longest_common_substring(self, other_text):
     return long_substring(self.data, other_text)