Avatar of Pedro Chagas
Pedro Chagas
Flag for Portugal

asked on 

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

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,
DatabasesPHPMySQL Server

Avatar of undefined
Last Comment
slightwv (䄆 Netminder)

8/22/2022 - Mon