Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Move to Chrome's fork of Hunspell #50

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open

Move to Chrome's fork of Hunspell #50

wants to merge 30 commits into from

Conversation

anaisbetts
Copy link
Contributor

@anaisbetts anaisbetts commented Jun 1, 2016

This PR moves Spellchecker to use the Chromium fork of Hunspell, which supports a format invented by Chromium called "bdict" files. bdict files are smaller and less weird (i.e. no aff files), and we're also guaranteed that Chrome keeps them up-to-date.

Unfortuately, compiling with bdict support disables the built-in support for dic/aff files, so this is a breaking change (though I've tried my best to keep the legacy API compatible).

The breaking change is, setDictionary now expects a Buffer as its second parameter, which is a loaded bdic file:

spellChecker.setDictionary('en_US', fs.readFileSync('path/to/en-us.bdic'));

A new method getURLForHunspellDictionary now will return the URL to download the dictionary file, given a language code.

TODO:

  • Windows
  • OS X
  • Linux

@anaisbetts
Copy link
Contributor Author

This is working okay in my testing, but still has some weird behavior where the first word is marked as an error if it's capitalized.

@Thomas101
Copy link

I've given this a go on osx and it looks like it works! Would be great to get this merged in and released as it looks like it closes #49 and #10

@ghost
Copy link

ghost commented Dec 1, 2016

I'm also keen for this functionality, is there anything that's stopping us from merging this? Is there anything still left to do before we can merge this?

@anaisbetts
Copy link
Contributor Author

anaisbetts commented Dec 2, 2016

@callodacity The capitalization bug is the only thing stopping us, my lldb skills are lacking, maybe @zcbenz can have a look if he's got a hot second? We're using this as a fork in electron-spellchecker and the Slack Desktop app and it mostly works (Chrome's dictionary has a few oddities, but in general it's good)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants