Skip to content

Commit

Permalink
Fix English word list retrieval in qmk generate-autocorrect-data (qmk…
Browse files Browse the repository at this point in the history
  • Loading branch information
fretep authored and autoferrit committed Dec 6, 2023
1 parent 185a6ec commit 6b30301
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 6b30301

Please sign in to comment.