Skip to content

Instantly share code, notes, and snippets.

@harakka
Created July 3, 2024 18:10
Show Gist options
  • Save harakka/179860afffdf002c11c11c8d7807b686 to your computer and use it in GitHub Desktop.
Save harakka/179860afffdf002c11c11c8d7807b686 to your computer and use it in GitHub Desktop.
with open("tools/spell_checker/dictionary.txt", "r", encoding="utf-8") as dict_lines:
sorted_dict_lines = sorted(dict_lines, key=lambda v: (v.lower(), v))
with open("tools/spell_checker/dictionary.txt", "w", encoding="utf-8") as dict_lines:
for line in sorted_dict_lines:
dict_lines.write(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment