Exemplo n.º 1
0
 def test_distance_sliding_window(self):
     """Test comparing two passages with the sliding window strategy"""
     t = TextReuse()
     comparisons = t.compare_sliding_window(demo_verg, demo_prop)
     self.assertEqual(comparisons[19][3].ratio, 0.64)
Exemplo n.º 2
0
 def test_distance_sentences(self):
     """Test comparing two passages tokenized at the sentence level"""
     t = TextReuse()
     comparisons = t.compare_sentences(demo_verg, demo_prop, 'latin')
     self.assertEqual(comparisons[1][0].ratio, 0.40)