Skip to content

nhabuiduc/hunspell

 
 

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

About

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

Resources

License

LGPL-2.1 and 4 other licenses found

Licenses found

LGPL-2.1
COPYING.LESSER
GPL-2.0
COPYING
Unknown
license.hunspell
Unknown
license.myspell
Unknown
COPYING.MPL

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 87.0%
  • M4 6.4%
  • Shell 2.7%
  • C 1.3%
  • Makefile 0.9%
  • JavaScript 0.9%
  • Other 0.8%