Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mm3sG-0004Jx-VV for pgsql-novice@arkaria.postgresql.org; Sun, 14 Nov 2021 01:00:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mm3sE-0001Vi-TU for pgsql-novice@arkaria.postgresql.org; Sun, 14 Nov 2021 00:59:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mm3sE-0001VR-JZ for pgsql-novice@lists.postgresql.org; Sun, 14 Nov 2021 00:59:58 +0000 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mm3s7-0004EZ-26 for pgsql-novice@lists.postgresql.org; Sun, 14 Nov 2021 00:59:57 +0000 Received: by mail-il1-x134.google.com with SMTP id s15so12643262ild.9 for ; Sat, 13 Nov 2021 16:59:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RUnwxNxG74fjJit+QSEVMUWlwUYjv7P+4Qq2M8G8mnQ=; b=JtO9W5jvmjksWC283bM5r7DzbSCybJKp1ie/ebwcAG6AmHY+n7jNEsk1R7W5OnAPL7 JKVfurKTvbb7RDj0YDCYoKSQ4mEPhTdYFpIfunPsaRInjGknFV8g0FXANnEgWFs1aKGJ rYx9nqYsxFgOTOfhmguarOSJ5R5cmprnEkKttjLVVSKfX//F+Vk04KSIadtT++mU/Rbr 3RXsI+JTNcaTfSsgx5BrleetmnLZ2SmrCUqiUzS63PbXieE1CwtXYa6epgbqQTvcQdZw jzqmwcAQ+NcXodtIIC3+Q9+3I7yxi4YhyFlm2V9KISZjF/XVwZHskFM/2pV8Ax1FKZjZ N1mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RUnwxNxG74fjJit+QSEVMUWlwUYjv7P+4Qq2M8G8mnQ=; b=TUO+sC2OSQT+jxDWYpNStt+hiWqgVjL31LM3FC1Sq8DXnlaZ3dFSA8dP+kh1HxkMG1 3xVw4MKOw3qMdmh0Bm51Rq5xj4s3jprlZWawuZeJ1wtuPECDTBnX+10EHzTv/YRteIdV adTSs15jFb+mfXKabUkzqXse7vz0Pgi87FvG9JpkdtscT0I2mgRa59NLbVfjMgk7DGQn i14cWu01+eU5A9/dZ0apHIw3Ye0X4BtlIjp3nDFt7TyPUIOFmOy/DSQckuiyvvHsjXXA gTYFpgsFbk85iudOYSAKfM1K6wZcgFLBrtxn/NddcoYBf2ZBxsxHFZvi4j8hH4x4Sh7v iEOg== X-Gm-Message-State: AOAM533X0dqdV5ZMyt0voFjMYV4HoH56kslIGqgorDkFc3AxGeCwBk+E TyH7U/xsadvKuTtJ/qLhUzEvjerkIV0CyIk2lvbRHkL+ceA= X-Google-Smtp-Source: ABdhPJzfN/qu56GelN5eTTKdjH8QoU8OO1abPNKXPbCn46TyorYd9uKTSRBoskSbSp2hMqLR+faDc193OM3ZjtmD/hU= X-Received: by 2002:a92:c0cb:: with SMTP id t11mr15096775ilf.154.1636851589108; Sat, 13 Nov 2021 16:59:49 -0800 (PST) MIME-Version: 1.0 References: <773cc2b745a9cf18e9bebbdb4b32d8077c6d4ee4.camel@cybertec.at> In-Reply-To: <773cc2b745a9cf18e9bebbdb4b32d8077c6d4ee4.camel@cybertec.at> From: Jean Baro Date: Sat, 13 Nov 2021 22:06:24 -0300 Message-ID: Subject: Re: Phonetic representation LENGHT for DMETAPHONE, is there a way to make it longer? To: Laurenz Albe Cc: pgsql-novice@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000084d96705d0b5350b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000084d96705d0b5350b Content-Type: text/plain; charset="UTF-8" Thank you very much. Em qui., 11 de nov. de 2021 13:11, Laurenz Albe escreveu: > 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 > > --00000000000084d96705d0b5350b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you very much.=C2=A0

Em qui., 11 de nov. de 2021 13:= 11, Laurenz Albe <laurenz.al= be@cybertec.at> escreveu:
On= Thu, 2021-11-11 at 11:26 -0300, Jean Baro wrote:
> Please, I am working on a PoC for Real-time Person=C2=A0Identification= , and one of the critical
> aspects of it is to support both minor misspelling and phonetic variat= ions of First, Middle, and Last name.
> Like HarinGton =3D=3D HarrinBton or RaphEAl =3D=3D RafAEl. It's wo= rking for longer names,
> but it's a bit more imprecise for names like Lee and John. I am us= ing Double Metaphone through dmetaphone() and
> dmetaphone_alt() in PostgreSQL 13.3 (Supabase.io). And although I appr= eciate Double Metaphone
> it returns a (too?) short string as the phonetic representation compar= ed to metaphone(string, length).
> metaphone() has parameters to make the resulting phonetic representati= on 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 representat= ion similar to metaphone()'s, but with a ALT variation?.=C2=A0

These functions focus on phonetic similarity.

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

=C2=A0 CREATE EXTENSION pg_trgm;

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

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

--00000000000084d96705d0b5350b--