[PHP] Spell Check

Has anybody implemented a spell check in PHP ?

which ones are available ? open source or any other ?

or if anybody has some code that would be fantastic.
:puzzle:

i dont see why this is technically difficult. all you need is an array of words and spelling checking by means of searching a word in the array.

but how will you suggest correct words ?

That’s hard but not difficult you get them out of a MySQL database and only check the first 5 chracters… then check. or write down all the posibilities for wrong words,

Gmail has a spellings check.

try this: http://aspell.sourceforge.net/

Weelll… Google makes its spellchecker available as a web service. I can’t go into the details of using it because I’ve never used web services before, but you could look into it :slight_smile:

since you asked this, i gave it some thought. this will be more of a computer science question. implementing it in php is another part of the problem.

option 1, you could try above suggestions.
option 2, you could reinvent the wheels.

common spelling errors include,
taht … adjacent letter swapped
somthing … missing letter
frase, klear … sound similar, … hmmm stuff
throught … thought or through, extra letter
thon … thin? because o is next to i.
etc etc

you can
1, compile a list of commonly misspelled ‘words’.
2, or, transform a misspelled ‘word’ according to how it might be misspelled, then search it in word-list again.
3, or, formulate a mathematical space, a word is a point in this space. assign a distance function on the space so that two similar words have short distance in between.
4, or google ‘spelling check implementation’

Thanks all you guys…

aspell is a pretty good option… i will check it out…

eirche

Immidiately this is not an option but this is interesting…

i dont think so… I mean look at the database size… there are 800,000 words in english… how many misspleed words might be there ? and who is going to enter them in the database ?

This seems to be a good option… But maybe it needs more discussion…

This is just an interface implementation… first we need to program the backend…