SOUNDEX function / in php - how to ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • siliconmike

    #1

    SOUNDEX function / in php - how to ?

    Hi I'm using SOUNDEX mysql function to find similar sounding names from
    a table with 2 million distinct names.

    Unfortunately there is a single soundex code for every 200,000 names!
    Meaning there are only 200,000 distinct codes for 2 million entries.

    Is there any other function / library / technique to work around this
    immense 1:10 redundancy ?

    for example, soundex for 'avis', 'apex' and 'apps' is A120, but I'd
    like to differentiate between them in my search - meaning implement a
    "stricter" sound comparison than the soundex function offers.

    Anything in PHP?

    Any pointers would be great


    Mike

  • Philip Ronan

    #2
    Re: SOUNDEX function / in php - how to ?

    siliconmike wrote:
    [color=blue]
    > Hi I'm using SOUNDEX mysql function to find similar sounding names from
    > a table with 2 million distinct names.
    >
    > Unfortunately there is a single soundex code for every 200,000 names!
    > Meaning there are only 200,000 distinct codes for 2 million entries.
    >
    > Is there any other function / library / technique to work around this
    > immense 1:10 redundancy ?
    >
    > for example, soundex for 'avis', 'apex' and 'apps' is A120, but I'd
    > like to differentiate between them in my search - meaning implement a
    > "stricter" sound comparison than the soundex function offers.
    >
    > Anything in PHP?[/color]

    Soundex is rather clumsy for this purpose. Use metaphone() instead, then use
    the levenshtein() function to sort the results based on their similarity to
    the search term

    --
    phil [dot] ronan @ virgin [dot] net



    Comment

    Working...