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

Fix English word list retrieval in qmk generate-autocorrect-data #20915

Merged
merged 2 commits into from
May 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/python/qmk/cli/generate/autocorrect_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ def parse_file(file_name: str) -> List[Tuple[str, str]]:
"""

try:
import english_words
correct_words = english_words.get_english_words_set(['web2'], lower=True, alpha=True)
except AttributeError:
from english_words import english_words_lower_alpha_set as correct_words
if not cli.args.quiet:
cli.echo('The english_words package is outdated, update by running:')
cli.echo(' {fg_cyan}python3 -m pip install english_words --upgrade')
except ImportError:
if not cli.args.quiet:
cli.echo('Autocorrection will falsely trigger when a typo is a substring of a correctly spelled word.')
Expand Down