Spell checking in web application has always been a big thing. Especially if you didn’t wanted to use available webservices like Google Spell Check due to security concerns.
Richard Willis did an amazing job by creatig a jQuery-based spell checker (http://jquery-spellchecker.badsyntax.co). Due to the modular built it can be used with different drivers supporting Pspell, Enchant and Google. Although the code seems not be maintained anymore, it can be used out of the box.
As I wanted to use a spell checker together with LanguageTool, another opensource software, offering spell checking and proof reading for 20+ languages, I decided to implement a separate driver for it. It can be found at my Github account.
All you need to do is to start the webserver built in in LanguageTool.
java -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8081
After that you can use the jQuery Spellchecker with it. To be flexible, the driver offers additional parameters:
- lang: Used to set proofing language (e.g. en-US)
- url: If your LanguageTool-server is running on a different host than your PHP/webserver
- port: LanguageTool-Server-Port
- disabled: Used to disable specific LanguageTool-rules. Use comma seperation if more than one rule should be disabled. As the jQuery Spellchecker is checking word by word, e.g. rules testing whole sentences doesn’t make sense and only lead to confusion.