jxmorris12 / language_tool_python

a free python grammar checker 📝✅
GNU General Public License v3.0
434 stars 64 forks source link

Allow handling of utf-8 encoded files when registering new spellings #43

Closed bzm3r closed 3 years ago

bzm3r commented 3 years ago

Currently, if you try to register a word like "Walchaís" (not accent on i) with language_tool_python, so that it is ignored in spell check, we get a Unicode encoding error. This can be fixed by letting the functions which read/write custom spellings: _register_spellings and _unregister_spellings.

We could improve this by letting these functions take a variable called encoding. Let me know what you'd like!

jxmorris12 commented 3 years ago

Thanks! This is great fix.