|
@ -14,10 +14,7 @@ for path, subdirs, files in os.walk(path): |
|
|
with open(file, encoding='utf-8') as f: |
|
|
with open(file, encoding='utf-8') as f: |
|
|
textfile = f.read() |
|
|
textfile = f.read() |
|
|
for word in wordlist_dict: |
|
|
for word in wordlist_dict: |
|
|
wordlinked = "<a href='/diverge?search="+word+"'>"+word+"</a>" |
|
|
word = re.escape(word) |
|
|
# wordlinked = re.escape(wordlinked) |
|
|
textfile = re.sub(r"(?<!<)(?<!</)(?<!ge\?)\b(%s)\b" %word, r"<a href='/diverge?search='\1'>\1</a>", textfile) |
|
|
print(wordlinked) |
|
|
|
|
|
# word = re.escape(word) |
|
|
print(textfile) |
|
|
print(word) |
|
|
|
|
|
# textfile = re.sub(word, wordlinked, textfile) |
|
|
|
|
|
# print(textfile) |
|
|
|
|
|