Exemple #1
0
 def test3(self):
     W = 'key'
     S = 'kekekeykykey'
     T = kmp_table(W)
     idx = kmp_search(S, W)
     print T, idx
Exemple #2
0
 def test1(self):
     W = 'abaababaabc'
     T = kmp_table(W)
     print T
Exemple #3
0
 def test2(self):
     W = 'abaababaabc'
     S = 'xabaababaabcxxxx'
     T = kmp_table(W)
     idx = kmp_search(S, W)
     print T, idx