pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Liudmila Mantrova <l.mantrova@postgrespro.ru>
To: Teodor Sigaev <teodor@sigaev.ru>
To: David Steele <david@pgmasters.net>
To: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Jan Przemysław Wójcik <jan.przemyslaw.wojcik@gmail.com>
Cc: Postgres-Bugs <pgsql-bugs@postgresql.org>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Fwd: [BUGS] pg_trgm word_similarity inconsistencies or bug
Date: Mon, 16 Apr 2018 19:48:47 +0300
Message-ID: <e9bf4e88-2d41-7627-85bf-aa57c24765ac@postgrespro.ru> (raw)
In-Reply-To: <b5cd33fa-aefc-4234-89e2-b3c1b763fe32@sigaev.ru>
References: <CY4PR17MB13207ED8310F847CF117EED0D85A0@CY4PR17MB1320.namprd17.prod.outlook.com>
	<20171028082225.GA2157@arthur.localdomain>
	<CAPpHfdtz4a9dTxp-Fpem8uBdSBuOQV_i2xuFyL1tG6zM6nAkpg@mail.gmail.com>
	<CA+YsLFp9scUNjjfYJC=84V9o-ZB66GWPq3e_Jveqs1bNejA4qA@mail.gmail.com>
	<CAPpHfdsDtQJ+pYfapH7GMt9n4RLByKMzHEBWcPL99C_g+rkUKQ@mail.gmail.com>
	<1510059095836-0.post@n3.nabble.com>
	<CA+Tgmobksqi+Kh2=NZarEhnSUAudY=3oc+K8HjqSRvytbw7cnQ@mail.gmail.com>
	<CAPpHfduRG6pXz8RC5TLppV7cpWeNPn0_4nNzX-nT4T6bb6_Y+Q@mail.gmail.com>
	<CAPpHfdtXJp0xvi8QbcHWqnrk=XyyMux4FtbJCgZFPknPbLERVA@mail.gmail.com>
	<42a3a2a4-59b9-c932-3bdf-e346e7b2e406@sigaev.ru>
	<CAPpHfdv1oYVxCmLxyEGNH7vb3Fy2s0xHdv9R_NUy5EHecUqijQ@mail.gmail.com>
	<CAPpHfdsfdC5L0xQ2QwshevbGnoL+L6Ex5B2eJq7FhSzFUqWg2Q@mail.gmail.com>
	<708593ed-1104-a0d2-56b7-097adfdcfc16@pgmasters.net>
	<b7263efb-d291-e51a-88f1-3c0e77711400@sigaev.ru>
	<2c90c840-b858-e513-cf9f-e3a04dcb0216@pgmasters.net>
	<b5cd33fa-aefc-4234-89e2-b3c1b763fe32@sigaev.ru>

Hi everyone,

When translating doc updates, Alexander Lakhin noticed that trigram 
examples were not quite accurate.
A small patch fixing this issue is attached.


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:
>>
>> +   <function>word_similarity(text, text)</function> requires further
>> +   explanation. Consider the following example:
>>
>> Maybe too verbose?  I think "<function>word_similarity(text,
>> text)</function> 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

Attachments:

pg-trgm-docfix.patch (text/x-patch, 1.2K) download 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 @@ </programlisting> In the first string, the set of trigrams is - <literal>{" w"," wo","ord","wor","rd "}</literal>. + <literal>{" w"," wo","wor","ord","rd "}</literal>. In the second string, the ordered set of trigrams is - <literal>{" t"," tw",two,"wo "," w"," wo","wor","ord","rds", ds "}</literal>. + <literal>{" t"," tw","two","wo "," w"," wo","wor","ord","rds","ds "}</literal>. The most similar extent of an ordered set of trigrams in the second string is <literal>{" w"," wo","wor","ord"}</literal>, and the similarity is <literal>0.8</literal>. @@ -172,7 +172,7 @@ At the same time, <function>strict_word_similarity(text, text)</function> has to select an extent that matches word boundaries. In the example above, <function>strict_word_similarity(text, text)</function> would select the - extent <literal>{" w"," wo","wor","ord","rds", ds "}</literal>, which + extent <literal>{" w"," wo","wor","ord","rds","ds "}</literal>, which corresponds to the whole word <literal>'words'</literal>. <programlisting>

view thread (28+ messages)  latest in thread

Message-ID: <e9bf4e88-2d41-7627-85bf-aa57c24765ac@postgrespro.ru>
Permalink:  ../e9bf4e88-2d41-7627-85bf-aa57c24765ac@postgrespro.ru/
Also on:    postgresql.org/message-id/e9bf4e88-2d41-7627-85bf-aa57c24765ac@postgrespro.ru

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: l.mantrova@postgrespro.ru, teodor@sigaev.ru, david@pgmasters.net, a.korotkov@postgrespro.ru, robertmhaas@gmail.com, jan.przemyslaw.wojcik@gmail.com, pgsql-bugs@postgresql.org
  Subject: Re: Fwd: [BUGS] pg_trgm word_similarity inconsistencies or bug
  In-Reply-To: <e9bf4e88-2d41-7627-85bf-aa57c24765ac@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox