Re: Phonetic representation LENGHT for DMETAPHONE, is there a way to make it longer?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Jean Baro <jfbaro(at)gmail(dot)com>, pgsql-novice(at)lists(dot)postgresql(dot)org
Subject: Re: Phonetic representation LENGHT for DMETAPHONE, is there a way to make it longer?
Date: 2021-11-11 16:11:50
Message-ID: 773cc2b745a9cf18e9bebbdb4b32d8077c6d4ee4.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, 2021-11-11 at 11:26 -0300, Jean Baro wrote:
> Please, I am working on a PoC for Real-time Person Identification, and one of the critical
> aspects of it is to support both minor misspelling and phonetic variations of First, Middle, and Last name.
> Like HarinGton == HarrinBton or RaphEAl == RafAEl. It's working for longer names,
> but it's a bit more imprecise for names like Lee and John. I am using Double Metaphone through dmetaphone() and
> dmetaphone_alt() in PostgreSQL 13.3 (Supabase.io). And although I appreciate Double Metaphone
> it returns a (too?) short string as the phonetic representation compared to metaphone(string, length).
> metaphone() has parameters to make the resulting phonetic representation longer.
> I investigated dmetaphone() and couldn't find anything other than the default function. Is there a way of making
> dmetaphone() and dmetaphone_alt() return a longer phonetic representation similar to metaphone()'s, but with a ALT variation?. 

These functions focus on phonetic similarity.

There are no other variants of these functions, but perhaps pattern matching
(which focuses on spelling, *not* phonetics) can help:

CREATE EXTENSION pg_trgm;

-- now you can use the "similar to" operator
SELECT * FROM tab WHERE name % 'lorenz';

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Mikael Sterner 2021-11-12 15:55:48 Why clear pg_wal when recovering?
Previous Message Jean Baro 2021-11-11 14:26:43 Phonetic representation LENGHT for DMETAPHONE, is there a way to make it longer?