Ajax Spell Checker on Windows

I ported over an Ajax spell checker with a Perl backend to PHP. See the DHTML / PHP Ajax spell checker demo. I’d put a demo up, but this web host doesn’t have the pspell extension installed. :(

You can still

This is basically a straight port of Emil’s code from Perl to PHP and includes an Aspell class wrapper from DokuWiki so that it runs on PHP5, IIS, and with Aspell 0.60.3 for win32.

It’s forced me to actually learn a little bit of Perl at long last. :)

I also use a file called Aspell.inc.php in this distribution. Instead of using the regular pspell PHP function calls, this wrapper allow me to use the latest version of Aspell and still maintain backwards compatibility with the pspell calling conventions. (It also, conveniently, closely matched the Perl calling conventions for the port.)

Usage

You’ll need to unzip the contents onto your own webserver with Aspell installed. Modify the spellchecker.js file so these lines point to the correct location:

serverURI    : 'demo_files/spell.php',
invalidWordBg: 'url(demo_files/redline.png) repeat-x bottom',

The demo.html file is a straight copy from Emil’s site. Test it out and let me know what you think.

The spell.txt is Emil’s original Perl backend file, if you want to compare the two versions for accuracy (which may be a good idea since I am not a Perl expert).

History

I started with Emil’s DHTML spell checker and got it working… but it works a lot better in Mozilla than in IE.

Next I checked out Live Spell Checker but I needed a solution that wasn’t specific to WordPress.

So after a quick look at googlespell I finally found the most robust solution out there (so far): Broken Notebook’s spell checker.

The only problem is… the way it’s written it seems you have to switch into a “spellcheck mode” and then back into “edit mode”.

I understand being able to turn it off or on (especially for performance reasons) but this almost defeats the purpose of having it be Ajax-ified (can I use that word?). Meaning: why not just do regular server roundtrip when they switch modes? I much prefer the way Emil’s one operates in terms of behavior. (It’s just not as mature yet.)

DokuWiki (which I was trying to implement this for) uses the Broken Notebook version, heavily modified. It doesn’t display things right because of my modifications to the template theme. Sigh… still more work to do.

One Comment on “Ajax Spell Checker on Windows”

Emil’s Chronicle » LiteSpellChecker, July 25th, 2005 at 6:02 pm

[...] I’ve also ported the backend to php (as have James and kepo-ing Zz85, thanks guys), however I had to make the argument adjustable for that to work, as PHP doesn’t seem to threat semicolon as a separator, only ampersand. [...]

Leave a Reply

Login Method

OpenID

Anonymous