/hunspell

The most popular spellchecking library. (converted to js using emscripten)

Primary LanguageC++GNU Lesser General Public License v2.1LGPL-2.1

Hunspell js

This is js library ported from Hunspell (c++)[https://github.com/hunspell/hunspell] using emscripten

Running Example

  • Goto js-output folder, and run a http server (for example using python: python -m SimpleHTTPServer 8080)
  • Open http://localhost:8080/ in browser
  • Current dictionary using is en-us, you can change to use another dictionary by modifing index.html:
    • change <script type="text/javascript" src="loader-en-us.js"></script> to <script type="text/javascript" src="loader-vi.js"></script>
    • it will change from en-us to vi
    • Example script now only preload with 2 dictionaries, if you want to add your own, please refer below section

How to build hunspell js from hunspell C++ manually, instruction based on MACOS only

How to build your own dictionaries

This repo only have to dictionaries (en-us and vi), to build your own dictionaries to use, following steps:

  • Download your dictionaries and put into dics-input folder in format:
    • [language-code]/data.aff
    • [language-code]/data.dic
  • Run ./scripts/dic-package.sh [path-of-file_packager.py]

Dictionaries

Hunspell (MySpell) dictionaries:

Aspell dictionaries (conversion: man 5 hunspell):

  • ftp://ftp.gnu.org/gnu/aspell/dict