PHP spell checker

rdegler

Member
Jan 20, 2002
184
0
0
Anyone have a very simple example of how to set up a spell check in php?

I am looking for something very simple just to get a feel for how the process works.

roy
 

Superwormy

Golden Member
Feb 7, 2001
1,637
0
0
Using the pspell library or...?

The way I'd do it is setup a MySQL database, with a `words` table, and parse out a freely available dictionary online ( project gutenburg ) and compare each word to that...

More details might help... what exactly are you trying to do / spellcheck / with what library / etc.?
 

rdegler

Member
Jan 20, 2002
184
0
0
I have tried aspell and pspell in php but it is apprently not installed.

I downloaded a program from sourceforge (http://spellerpages.sourceforge.net/) and it works great. It executes a command line to preform the task. Most of the code is a little over my head.

But this works OK.

All I want to do is check words in a textbox and respond with a line like Google uses Did you mean ...
with suggested spellings.

It would be great at this time to be able to do something like this


***Psuedo code ***

$word = "tesst"; /or get contents of text box
$cmd = "aspell suggest $word";

$suggestion= exec ($cmd);

if ($suggestion is not blank){
echo "Did you mean $suggestion";
}

roy