mirror of
https://github.com/utkusen/turkce-wordlist.git
synced 2026-10-04 12:38:58 +00:00
14 lines
395 B
Python
14 lines
395 B
Python
import ahocorasick
|
|
|
|
with open("corpus.txt") as corpus:
|
|
auto = ahocorasick.Automaton()
|
|
for word in corpus:
|
|
word = word.rstrip('\n')
|
|
auto.add_word(word, word)
|
|
auto.make_automaton()
|
|
|
|
with open("PAROLA_VERISI.txt") as wordlist:
|
|
for no, line in enumerate(wordlist):
|
|
for end_ind, found in auto.iter(line ):
|
|
print(line.replace("\n",""))
|