diff options
author | Peter <fretep@users.noreply.github.com> | 2023-05-20 12:11:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-20 22:11:57 +1000 |
commit | 7b31c18d464356bde219c5b3fff346f3e7a89d1a (patch) | |
tree | f908d4e4cf48c7128f6c582195387ab82e5411f3 /lib/python | |
parent | 9dec31d0561b3982cd944d6ff4682c685ccde3a9 (diff) |
Fix English word list retrieval in qmk generate-autocorrect-data (#20915)
Diffstat (limited to 'lib/python')
-rw-r--r-- | lib/python/qmk/cli/generate/autocorrect_data.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/python/qmk/cli/generate/autocorrect_data.py b/lib/python/qmk/cli/generate/autocorrect_data.py index 5b70e0cb4e..b11c66d95d 100644 --- a/lib/python/qmk/cli/generate/autocorrect_data.py +++ b/lib/python/qmk/cli/generate/autocorrect_data.py @@ -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.') |