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 1f87JI-0006eH-P3 for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Apr 2018 16:48:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f87JH-0002CH-B1 for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Apr 2018 16:48:55 +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 1f87JG-0002C4-Qg; Mon, 16 Apr 2018 16:48:55 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f87JC-0007F2-SX; Mon, 16 Apr 2018 16:48:53 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id A0A9621C1F9A; Mon, 16 Apr 2018 19:48:48 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from [192.168.27.124] (gw.postgrespro.ru [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 6CF5621C1F99; Mon, 16 Apr 2018 19:48:47 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1523897328; bh=zx5YRHurv0cGF/0h+AweusLOsEj69s4Mepz7h/EO4MA=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=mKJpMNozafVnKINjSndT9VhUJ5zPwE2W3gX4AApWeoSCDPOIY3PEVVg1AOARDvi3v p/8qApUDLUtKKAKrdu2YliEs85ZY6vGQ1G/6GxmoySVJesE/jrLkjoSGGspuT/cQzs bU8EvigT3rRiX8ZQKY278kW/Q9dNE2EPfBKYzkF4= Subject: Re: Fwd: [BUGS] pg_trgm word_similarity inconsistencies or bug To: Teodor Sigaev , David Steele , Alexander Korotkov Cc: Robert Haas , =?UTF-8?Q?Jan_Przemys=c5=82aw_W=c3=b3jcik?= , Postgres-Bugs , "pgsql-hackers@postgresql.org" References: <20171028082225.GA2157@arthur.localdomain> <1510059095836-0.post@n3.nabble.com> <42a3a2a4-59b9-c932-3bdf-e346e7b2e406@sigaev.ru> <708593ed-1104-a0d2-56b7-097adfdcfc16@pgmasters.net> <2c90c840-b858-e513-cf9f-e3a04dcb0216@pgmasters.net> From: Liudmila Mantrova Message-ID: Date: Mon, 16 Apr 2018 19:48:47 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------B65D6F73B176F569ACC82DE4" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------B65D6F73B176F569ACC82DE4 Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 8bit 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: >> >> +šš 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 --------------B65D6F73B176F569ACC82DE4 Content-Type: text/x-patch; name="pg-trgm-docfix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pg-trgm-docfix.patch" 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'. --------------B65D6F73B176F569ACC82DE4--