Forum Moderators: phranque

Message Too Old, No Replies

Spellchecker or Fuzzy Logic

         

Imaster

1:33 pm on Nov 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How do you implement a spellchecker or Fuzzy Logic for a search engine or yellow pages. Are there any database/scripts available to implement them in our internal programs?

brotherhood of LAN

1:43 pm on Nov 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hey Imaster,

I see i nthe other thread your'e using PHP.

Check out the soundex(), metaphone() and levenshtein() functions, all can be used to make some sort of spelling correction engine.

I posted a script a while back in here, wasn't anywhere near perfect but gave decent suggestions for misspelled words...

If you have a dictionary of words, you can use these functions to compute the similarity between a word in there and a word you want to check for spelling.

More than one way to skin a cat, sometimes more than one way to spell the same word too :)

brotherhood of LAN

1:59 pm on Nov 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



here it is

[webmasterworld.com...]

disclaimer: i was and still am a php newbie :)

Imaster

1:59 pm on Nov 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks a lot. You are right. I want to use it for PHP. I am looking at this one currently <http://www.php.net/manual/en/ref.pspell.php> Aspell.

I will also look into what you mentioned. Thanks a lot. :)

Imaster

2:01 pm on Nov 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Btw, I wish to have the spell suggestions from a complete dictionary (maybe public domain one), so that I have a complete list of similar words ;)

Imaster

2:03 pm on Nov 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



disclaimer: i was and still am a php newbie
Then how do I introduce myself? ;)

brotherhood of LAN

2:18 pm on Nov 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



A fellow newbie ;) I think that script I wrote was a few months after reading through the functions..

>spell suggestions from a complete dictionary

The one i used was the unix dictionary, it's not "complete" but has 300,000 words in it, so you could use it to fine tune the script before the dictionary grows. There are a few other txt files you can grab hold of , or use something like www.dict.org/

You could have the dictionary in a flat file, or mysql table. Do post what you use ;) I'm looking for more info on this sort of thing too.