Levenshtein function cost parameters are in the wrong order

Lists: pgsql-docs
From: marco(dot)pennekamp96(at)gmail(dot)com
To: pgsql-docs(at)postgresql(dot)org
Subject: Levenshtein function cost parameters are in the wrong order
Date: 2017-10-02 15:37:09
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: 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).


From: Marko Tiikkaja <marko(at)joh(dot)to>
To: marco(dot)pennekamp96(at)gmail(dot)com
Cc: pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Levenshtein function cost parameters are in the wrong order
Date: 2017-10-03 12:34:31
Message-ID: CAL9smLARFpN0Yf3+DUJo_PRFqqohTsPc6q6Ovmwik4vQ=b7bwA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-docs

On Mon, Oct 2, 2017 at 5:37 PM, <marco(dot)pennekamp96(at)gmail(dot)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


From: Marco Pennekamp <marco(dot)pennekamp96(at)gmail(dot)com>
To: Marko Tiikkaja <marko(at)joh(dot)to>
Cc: pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Levenshtein function cost parameters are in the wrong order
Date: 2017-10-03 12:41:42
Message-ID: CAO+D04XA_5mg=EwD5XKkEhqoDqrBmA5MjdR5xYso6hbt-EgxSw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: 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(at)joh(dot)to> wrote:

> On Mon, Oct 2, 2017 at 5:37 PM, <marco(dot)pennekamp96(at)gmail(dot)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
>