[postgis-users] Fuzzy phonetic matching

Stephen Woodbridge stephenwoodbridge37 at gmail.com
Tue Jan 5 18:41:14 PST 2021


I do addresses by terms after I standardize the address. I then assign a 
weight to each part of the address and compute a levenstein distance 
based on the input term verses the matched term, then some distance * 
weight for all terms to generate a score for that address. Because fuzzy 
searching will return multiple rows, I order each by the score value 
ascending and the first row is the best match of the input address.

If you haven't read this already:
https://github.com/woodbri/imaptools.com/blob/master/README-geocoder-design.md
https://github.com/woodbri/address-standardizer/blob/develop/DOCUMENTATION.md

If you are just trying to match arbitrary phrases against various 
records of text, you might look into the full text search facility that 
postgresql has. This will help you find potential record matches, but 
you still need a way to score them so you can determine which is the 
best match.

-Steve



On 1/5/2021 6:10 PM, Shaozhong SHI wrote:
> Hi, Steve,
>
> Which one can do whole phrases?
>
> Regards,
>
> David
>
> On Tue, 5 Jan 2021 at 15:53, Stephen Woodbridge 
> <stephenwoodbridge37 at gmail.com <mailto:stephenwoodbridge37 at gmail.com>> 
> wrote:
>
>     My geocode has that built in. You look at that to get some ideas.
>
>     I recommend using double metaphone for phonetic comparison rather
>     than soundex.  Also you can’t do whole phrases you have to do it
>     word by word and sun the differences of each word to score the
>     phrase.
>
>     -Steve
>
>     Sent from my iPhone
>
>     > On Jan 5, 2021, at 3:13 AM, Shaozhong SHI
>     <shishaozhong at gmail.com <mailto:shishaozhong at gmail.com>> wrote:
>     >
>     > Has anyone tested phonetic matching of phrases?
>     >
>     > Any practical example to show how it works?
>     >
>     > Regards,
>     > David
>     > _______________________________________________
>     > postgis-users mailing list
>     > postgis-users at lists.osgeo.org <mailto:postgis-users at lists.osgeo.org>
>     > https://lists.osgeo.org/mailman/listinfo/postgis-users
>     <https://lists.osgeo.org/mailman/listinfo/postgis-users>
>     _______________________________________________
>     postgis-users mailing list
>     postgis-users at lists.osgeo.org <mailto:postgis-users at lists.osgeo.org>
>     https://lists.osgeo.org/mailman/listinfo/postgis-users
>     <https://lists.osgeo.org/mailman/listinfo/postgis-users>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users



More information about the postgis-users mailing list