Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBm5K-0006Iv-CA for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Apr 2018 18:57:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fBm5I-0000G1-Vf for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Apr 2018 18:57:36 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBm5I-0000Fn-Lp; Thu, 26 Apr 2018 18:57:36 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fBm5F-0001gP-9D; Thu, 26 Apr 2018 18:57:35 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1fBm55-0007Ze-Ho; Thu, 26 Apr 2018 14:57:23 -0400 Date: Thu, 26 Apr 2018 14:57:23 -0400 From: Bruce Momjian To: Liudmila Mantrova Cc: Teodor Sigaev , David Steele , Alexander Korotkov , Robert Haas , Jan =?utf-8?Q?Przemys=C5=82aw_W=C3=B3jcik?= , Postgres-Bugs , "pgsql-hackers@postgresql.org" Subject: Re: Fwd: [BUGS] pg_trgm word_similarity inconsistencies or bug Message-ID: <20180426185723.GB736@momjian.us> References: <42a3a2a4-59b9-c932-3bdf-e346e7b2e406@sigaev.ru> <708593ed-1104-a0d2-56b7-097adfdcfc16@pgmasters.net> <2c90c840-b858-e513-cf9f-e3a04dcb0216@pgmasters.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Apr 16, 2018 at 07:48:47PM +0300, Liudmila Mantrova wrote: > Hi everyone, > > When translating doc updates, Alexander Lakhin noticed that trigram examples > were not quite accurate. > A small patch fixing this issue is attached. FYI, this has been applied by Teodor Sigaev: https://git.postgresql.org/pg/commitdiff/9975c128a1d1bd7e7366adf133b21540a2bc2450 --------------------------------------------------------------------------- > > > On 03/21/2018 03:35 PM, Teodor Sigaev wrote: > >Thank you, pushed > > > >David Steele wrote: > >>On 3/6/18 7:04 AM, Teodor Sigaev wrote: > >>>>I agree with Teodor (upthread, not quoted here) that the documentation > >>>>could use some editing. > >>>> > >>>>I started to do it myself, but quickly realized I have no knowledge of > >>>>the content.  I'm afraid I would destroy the meaning while updating > >>>>the > >>>>grammar. > >>>> > >>>>Anyone understand the subject matter well enough to review the > >>>>documentation? > >>> > >>>Liudmila tried to improve docs in Alexander's patchset. > >>> > >>>https://www.postgresql.org/message-id/f43b242d-000c-f4c8-cb8b-d37e9752cd93@postgrespro.ru > >>> > >> > >>This looks good to me with a few minor exceptions: > >> > >>+   word_similarity(text, text) requires further > >>+   explanation. Consider the following example: > >> > >>Maybe too verbose?  I think "word_similarity(text, > >>text) requires further explanation." can be removed entirely. > >> > >>+   string.  However, this function does not add paddings to the > >> > >>"add padding" > >> > >>>BTW, adding Liudmila's message to commitfest task > >>>(https://commitfest.postgresql.org/17/1403/) doesn't work > >> > >>Doesn't work for me either. > >> > >>Alexander, can you post the final patches to the thread so they show up > >>in the CF app? > >> > >>Thanks, > >> > > > > -- > Liudmila Mantrova > Postgres Professional: http://www.postgrespro.com > The Russian Postgres Company > > diff --git a/doc/src/sgml/pgtrgm.sgml b/doc/src/sgml/pgtrgm.sgml > index 8f39529..be43cdf 100644 > --- a/doc/src/sgml/pgtrgm.sgml > +++ b/doc/src/sgml/pgtrgm.sgml > @@ -152,9 +152,9 @@ > > > In the first string, the set of trigrams is > - {" w"," wo","ord","wor","rd "}. > + {" w"," wo","wor","ord","rd "}. > In the second string, the ordered set of trigrams is > - {" t"," tw",two,"wo "," w"," wo","wor","ord","rds", ds "}. > + {" t"," tw","two","wo "," w"," wo","wor","ord","rds","ds "}. > The most similar extent of an ordered set of trigrams in the second string > is {" w"," wo","wor","ord"}, and the similarity is > 0.8. > @@ -172,7 +172,7 @@ > At the same time, strict_word_similarity(text, text) > has to select an extent that matches word boundaries. In the example above, > strict_word_similarity(text, text) would select the > - extent {" w"," wo","wor","ord","rds", ds "}, which > + extent {" w"," wo","wor","ord","rds","ds "}, which > corresponds to the whole word 'words'. > > -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +