Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError by ignoring a typo with multiple cases #50

Open
e-kwsm opened this issue Feb 6, 2020 · 0 comments
Open

KeyError by ignoring a typo with multiple cases #50

e-kwsm opened this issue Feb 6, 2020 · 0 comments

Comments

@e-kwsm
Copy link
Contributor

e-kwsm commented Feb 6, 2020

Steps to reproduce:

$ cat << EOF > typo.txt
Typo: Abilty (title)
Typo: abilty (lower)
EOF
$ python3 -m typochecker.corrector -d .
Getting list of typos
Information from https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines
opening /tmp/typochecker/typochecker/../data/wikipedia_common_misspellings.txt
opening /tmp/typochecker/typochecker/../data/extra_endings.txt
Will search through 1 files
Suggestions follow for file ./typo.txt
file_typos: ['Abilty', 'abilty']
Typo: Abilty (title)

     ^^^^^^^^^
Suggestion: Ability
Correction ("!h" for help), default to Ability: !i
Traceback (most recent call last):
  File "/tmp/typochecker/typochecker/corrector.py", line 237, in <module>
    res = iterate_over_file(search_file, typos, file_typos)
  File "/tmp/typochecker/typochecker/corrector.py", line 127, in iterate_over_file
    all_typos.get(matched_typo, None) or all_typos[matched_typo.lower()], matched_typo)
KeyError: 'abilty'

I took a glance but cannot find the cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant