pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Levenshtein function cost parameters are in the wrong order
3+ messages / 3 participants
[nested] [flat]

* Levenshtein function cost parameters are in the wrong order
@ 2017-10-02 15:37  marco.pennekamp96@gmail.com
  0 siblings, 1 reply; 3+ messages in thread

From: marco.pennekamp96@gmail.com @ 2017-10-02 15:37 UTC (permalink / raw)
  To: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.6/static/fuzzystrmatch.html
Description:

The fuzzystrmatch documentation says that the order for the Levenshtein cost
parameters is insertion, deletion, substitution. Based on my tests with
Postgres 9.4, the order should be deletion, insertion, substitution, since
the algorithm behaves that way (this can be easily checked).

-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Levenshtein function cost parameters are in the wrong order
@ 2017-10-03 12:34  Marko Tiikkaja <marko@joh.to>
  parent: marco.pennekamp96@gmail.com
  0 siblings, 1 reply; 3+ messages in thread

From: Marko Tiikkaja @ 2017-10-03 12:34 UTC (permalink / raw)
  To: marco.pennekamp96@gmail.com; +Cc: pgsql-docs

On Mon, Oct 2, 2017 at 5:37 PM, <marco.pennekamp96@gmail.com> wrote:

> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/9.6/static/fuzzystrmatch.html
> Description:
>
> The fuzzystrmatch documentation says that the order for the Levenshtein
> cost
> parameters is insertion, deletion, substitution. Based on my tests with
> Postgres 9.4, the order should be deletion, insertion, substitution, since
> the algorithm behaves that way (this can be easily checked).


I did check, and they seem correct to me:

  =# select levenshtein('aaa', 'aaab', 1, 100, 100);
   levenshtein
  -------------
             1
  (1 row)

Notice that the order of the first two arguments is (source, target).


.m

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Levenshtein function cost parameters are in the wrong order
@ 2017-10-03 12:41  Marco Pennekamp <marco.pennekamp96@gmail.com>
  parent: Marko Tiikkaja <marko@joh.to>
  0 siblings, 0 replies; 3+ messages in thread

From: Marco Pennekamp @ 2017-10-03 12:41 UTC (permalink / raw)
  To: Marko Tiikkaja <marko@joh.to>; +Cc: pgsql-docs

Oh, yeah. I didn't think about the source/target order! Thank you for
checking and sorry for the inconvenience!

On Tue, Oct 3, 2017 at 2:34 PM Marko Tiikkaja <marko@joh.to> wrote:

> On Mon, Oct 2, 2017 at 5:37 PM, <marco.pennekamp96@gmail.com> wrote:
>
>> The following documentation comment has been logged on the website:
>>
>> Page: https://www.postgresql.org/docs/9.6/static/fuzzystrmatch.html
>> Description:
>>
>> The fuzzystrmatch documentation says that the order for the Levenshtein
>> cost
>> parameters is insertion, deletion, substitution. Based on my tests with
>> Postgres 9.4, the order should be deletion, insertion, substitution, since
>> the algorithm behaves that way (this can be easily checked).
>
>
> I did check, and they seem correct to me:
>
>   =# select levenshtein('aaa', 'aaab', 1, 100, 100);
>    levenshtein
>   -------------
>              1
>   (1 row)
>
> Notice that the order of the first two arguments is (source, target).
>
>
> .m
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2017-10-03 12:41 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-10-02 15:37 Levenshtein function cost parameters are in the wrong order marco.pennekamp96@gmail.com
2017-10-03 12:34 ` Marko Tiikkaja <marko@joh.to>
2017-10-03 12:41   ` Marco Pennekamp <marco.pennekamp96@gmail.com>

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