-
Notifications
You must be signed in to change notification settings - Fork 506
Closed
Description
Some of the suggested replacements in dictionary.txt are listed as mistakes themselves.
Examples:
mimimise->minimise
minimise->minimize
orginal->orignal
orignal->original
passtime->pasttime
pasttime->pastime
shrinked->shrunk
srinkd->shrinked
srinked->shrinked
tranfering->transfering
transfering->transferring
Code to find these mistakes:
bad_words, new_words = {}, set()
lines = [line[:-1] for line in open('dictionary.txt')]
for line in lines:
orig, replacements = line.split('->')
bad_words[orig] = {word.strip() for word in replacements.split(',')}
new_words.update(bad_words[orig])
highlight = {word for word in new_words if word in bad_words and word not in bad_words[word]}
for line in lines:
if any(word in line for word in highlight):
print(line)Metadata
Metadata
Assignees
Labels
No labels