Add Spell Check in PHP With PSpell
Most applications like browsers, text editors, etc. come built in with spelling suggestions, they highlight a possible incorrect English word (any language for that matter) and offers a list of suggestions when clicked or selected. Even, search engines provide spelling suggestions.
Even you might want to provide spelling corrections to your web application, with PHP and it's Pspell extension it wouldn't be very hard to implement. Pspell extension uses the Aspell library (http://aspell.sourceforge.net/). In this article we will look at installing & using the Pspell extension for spelling suggestions.
You need to have Aspell library to compile PHP with Pspell extension, add the following option with path Aspell source to configure:
For Windows users, get the ASpell for Windows from Aspell webiste, then get the dictionaries you need from (http://aspell.net/win32/), finally in the php.ini enable extension=php_pspell.dll.
I'll demonstrate a few basic examples of Pspell, try and tweak according to your requirements.
Well, that's all there needs to be known for you to enable your application to check spelling. Please give feedback and experiences to the community.
|All times are GMT +5.5. The time now is 13:50.|