chrisknepper / android-messages-desktop

Android Messages as a Cross-platform Desktop App
MIT License
1.01k stars 116 forks source link

Feature/spell check 2 #124

Closed chrisknepper closed 5 years ago

chrisknepper commented 5 years ago

For real this time, spell-check with Hunspell on all platforms, using no native dependencies. Using the apparently excellent and relatively new electron-hunspell library. Appears to be extremely fast and adds virtually no size to the binary.

This was a lot of fun to implement and seems to be, by far, the best option. The other libraries were cumbersome (due to native dependencies) and don't seem as maintained.

Dictionary files are provided by the also-excellent dictionaries which appear to mirror the same .dic and .aff files used by Google Chrome. This means, at least in English, more recent words (such as "selfie") will not be considered typos.

The dictionary files for your language are downloaded the first time the application launches after the update. If you change your system language and restart the app, it should download the dictionaries for the new language and check spelling accordingly, as long as the spell-checker supports that language. If it were not implemented this way and I just included all dictionary files in the app, it would double the size of the app .gzipped. The total unzipped size of the dictionary files for all languages is over 200 megabytes.

Each language will maintain its own distinct list of words you add to the dictionary.

See #121 for more details on this feature and implementation notes.

ajivoin commented 5 years ago

On a first pass through it looks good, it's a large changeset so I'll look over everything again.

I'll pull down the branch and mess with it to see if I notice anything weird going on. I'll follow up here after I do that.

Good work implementing spellchecking!

chrisknepper commented 5 years ago

About to release. This also includes an update to Electron 3.x because of dependency requirements. Thanks for your help again @ajivoin

Geronimo!