From b8c46c0319d3f98a178e56dbea5694c06b0dddf2 Mon Sep 17 00:00:00 2001 From: Qrox Date: Tue, 9 Apr 2024 16:03:19 +0800 Subject: [PATCH] Ignore case when sorting generated dictionary --- tools/spell_checker/gen_dictionary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/spell_checker/gen_dictionary.py b/tools/spell_checker/gen_dictionary.py index c302d8782b538..d24798b710474 100644 --- a/tools/spell_checker/gen_dictionary.py +++ b/tools/spell_checker/gen_dictionary.py @@ -24,5 +24,5 @@ def gen_dictionary(): dictionary.add(norm) dict_path = os.path.join(os.path.dirname(__file__), "dictionary.txt") with open(dict_path, "w", encoding="utf-8") as fp: - for word in sorted(dictionary): + for word in sorted(dictionary, key=lambda v: (v.lower(), v)): print(word, file=fp)