コード例 #1
0
 def test_multiple_hits(self):
     res = search_rabin_multi("ktovtehplamenehtotmistrjan", ["to"])
     self.assertTrue(res == [[1, 15]])
コード例 #2
0
 def test_simple_pattern_search(self):
     res = search_rabin_multi("kdovtechplamenech", ["ovte"])
     self.assertTrue(res == [[2]])
コード例 #3
0
 def test_complex_case(self):
     res = search_rabin_multi("svoboda je svoboda", ["svo", "svoboda je svoboda", "da ", "табор"])
     self.assertTrue(res == [[0, 11], [0], [5], []])
コード例 #4
0
 def test_multi_pattern(self):
     res = search_rabin_multi("brante vlast a cechu slavu", ["bran", "chu"])
     self.assertTrue(res == [[0], [17]])
コード例 #5
0
 def test_disjoint_alphabets(self):
     res = search_rabin_multi("avtechtojasnychpravdyplamenech", ["чаша"])
     self.assertTrue(res == [[]])
コード例 #6
0
 def test_no_hits(self):
     res = search_rabin_multi("hranicevzpala", ["kalich"])
     self.assertTrue(res == [[]])