troubleshooting Question

Alternative to MySql Soundex (for get more words)(php)

Avatar of Pedro Chagas
Pedro ChagasFlag for Portugal asked on
DatabasesPHPMySQL Server
2 Comments1 Solution18 ViewsLast Modified:
Hi E's,
I try to create my own spellchecker, using php and mysql, and I use this code to get similar words from my data base (that have 1.000.000 words):
$consulta = $pdo->query("SELECT palavra FROM config_palavras_portuguesas where soundex(palavra) = soundex('$palavra_escrita')");
    while($final = $consulta->fetch(PDO::FETCH_ASSOC)){

Open in new window

MySql Soundex work almost perfect, but there is a defect, if I try to get similiar words for "rabacco", the output is always words started with "r", and in this example, I will never get the most logical word for the mistake "rabacco", that is "tabacco".

Could there possibly be another call to the database, which can solve the problem of the first letter?

The best regards,
JC
ASKER CERTIFIED SOLUTION
Andrei Fomitchev
Sr. DBA

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros