Re: Configurable Penalty Costs for Levenshtein

Lists: pgsql-patches
From: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
To: pgsql-patches(at)postgresql(dot)org
Subject: Configurable Penalty Costs for Levenshtein
Date: 2007-10-17 14:02:44
Message-ID: 87bqax7saj.fsf@ttnet.net.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Hi,

Following patch implements configurable penalty costs for levenshtein
distance metric in fuzzystrmatch contrib module.

It doesn't introduce any compatibility issues. Just implements

levenshtein(text,text,int,int,int)

function on top of fuzzystrmatch.c:levenshtein_internal(). At the
same time, levenshtein(text,text) becomes just a wrapper for
levenshtein(text,text,1,1,1) call.

BTW, in current CVS tip

if (cols/rows == 0) ...

checks in fuzzyztrmatch.c:levenshtein() never fail because of

cols/rows = strlen(...) + 1;

FYI.

Regards.

Attachment Content-Type Size
fuzzystrmatch-levenshtein.patch text/x-diff 11.3 KB

From: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: Configurable Penalty Costs for Levenshtein
Date: 2007-11-01 19:36:59
Message-ID: 87zlxxvjtw.fsf@ttnet.net.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr> writes:
> Following patch implements configurable penalty costs for levenshtein
> distance metric in fuzzystrmatch contrib module.

Is there a problem with the patch? Would anybody mind helping me to
figure out the reason of this lack of interest, after 15 days.

Regards.


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Configurable Penalty Costs for Levenshtein
Date: 2007-11-01 21:30:40
Message-ID: 200711012130.lA1LUeZ15662@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Volkan YAZICI wrote:
> Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr> writes:
> > Following patch implements configurable penalty costs for levenshtein
> > distance metric in fuzzystrmatch contrib module.
>
> Is there a problem with the patch? Would anybody mind helping me to
> figure out the reason of this lack of interest, after 15 days.

I will review it in the next few days. Sorry. I am just doing a
cleanup now.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Configurable Penalty Costs for Levenshtein
Date: 2007-11-01 21:37:18
Message-ID: 15786.1193953038@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr> writes:
> Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr> writes:
>> Following patch implements configurable penalty costs for levenshtein
>> distance metric in fuzzystrmatch contrib module.

> Is there a problem with the patch? Would anybody mind helping me to
> figure out the reason of this lack of interest, after 15 days.

The reason is the project schedule: we're trying to get 8.3 out the
door. No one is likely to pay any attention to new-feature patches
until after 8.4 development begins.

regards, tom lane


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Configurable Penalty Costs for Levenshtein
Date: 2007-11-05 16:33:42
Message-ID: 200711051633.lA5GXgP05812@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


This has been saved for the 8.4 release:

http://momjian.postgresql.org/cgi-bin/pgpatches_hold

---------------------------------------------------------------------------

Volkan YAZICI wrote:
> Hi,
>
> Following patch implements configurable penalty costs for levenshtein
> distance metric in fuzzystrmatch contrib module.
>
> It doesn't introduce any compatibility issues. Just implements
>
> levenshtein(text,text,int,int,int)
>
> function on top of fuzzystrmatch.c:levenshtein_internal(). At the
> same time, levenshtein(text,text) becomes just a wrapper for
> levenshtein(text,text,1,1,1) call.
>
> BTW, in current CVS tip
>
> if (cols/rows == 0) ...
>
> checks in fuzzyztrmatch.c:levenshtein() never fail because of
>
> cols/rows = strlen(...) + 1;
>
> FYI.
>
>
> Regards.

Content-Description: Configurable Penalty Costs for Levenshtein

>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
>
> http://www.postgresql.org/about/donate

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: Configurable Penalty Costs for Levenshtein
Date: 2007-11-28 13:10:13
Message-ID: 877ik2wm6i.fsf@ttnet.net.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Hi,

I noticed a small typo in the patch.

prev = palloc((m + n) * sizeof(char));

line should look like

prev = palloc(2 * m * sizeof(char));

instead.

Regards.


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Configurable Penalty Costs for Levenshtein
Date: 2007-11-28 14:54:40
Message-ID: 200711281454.lASEse805903@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


This has been saved for the 8.4 release:

http://momjian.postgresql.org/cgi-bin/pgpatches_hold

---------------------------------------------------------------------------

Volkan YAZICI wrote:
> Hi,
>
> I noticed a small typo in the patch.
>
> prev = palloc((m + n) * sizeof(char));
>
> line should look like
>
> prev = palloc(2 * m * sizeof(char));
>
> instead.
>
>
> Regards.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Configurable Penalty Costs for Levenshtein
Date: 2008-03-12 02:06:59
Message-ID: 10528.1205287619@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr> writes:
> I noticed a small typo in the patch.
> prev = palloc((m + n) * sizeof(char));
> line should look like
> prev = palloc(2 * m * sizeof(char));
> instead.

If that's wrong, aren't the comments and the length restriction limit
also wrong?

regards, tom lane


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Configurable Penalty Costs for Levenshtein
Date: 2008-04-03 00:35:08
Message-ID: 200804030035.m330Z8112189@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Because of lack of reply from the author, this has been saved for the
next commit-fest:

http://momjian.postgresql.org/cgi-bin/pgpatches_hold

---------------------------------------------------------------------------

Tom Lane wrote:
> Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr> writes:
> > I noticed a small typo in the patch.
> > prev = palloc((m + n) * sizeof(char));
> > line should look like
> > prev = palloc(2 * m * sizeof(char));
> > instead.
>
> If that's wrong, aren't the comments and the length restriction limit
> also wrong?
>
> regards, tom lane
>
> --
> Sent via pgsql-patches mailing list (pgsql-patches(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-patches

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Volkan YAZICI <yazicivo(at)ttmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Configurable Penalty Costs for Levenshtein
Date: 2008-04-03 06:18:31
Message-ID: 87wsnf8nrc.fsf@alamut.mobiliz.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Hi,

Sorry for the delay, but the reply of Tom didn't reach me. I've modified
the patch according to Tom's comments. I hope I am not too late.

Regards.

Attachment Content-Type Size
fuzzystrmatch-levenshtein.patch.1 application/octet-stream 9.2 KB

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Volkan YAZICI <yazicivo(at)ttmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Configurable Penalty Costs for Levenshtein
Date: 2008-04-03 15:50:47
Message-ID: 200804031550.m33Folp03029@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Volkan YAZICI wrote:
> Hi,
>
> Sorry for the delay, but the reply of Tom didn't reach me. I've modified
> the patch according to Tom's comments. I hope I am not too late.

OK, great. I will re-add it to the current queue and add this email as
well.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Volkan YAZICI <yazicivo(at)ttmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Configurable Penalty Costs for Levenshtein
Date: 2008-04-03 21:19:19
Message-ID: 22834.1207257559@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Volkan YAZICI <yazicivo(at)ttmail(dot)com> writes:
> Sorry for the delay, but the reply of Tom didn't reach me. I've modified
> the patch according to Tom's comments. I hope I am not too late.

Applied after considerable revision. This patch:

* introduced a memory stomp that was not there before (I strongly
recommend testing C code in an --enable-cassert build)
* added a user-visible feature without documenting it
* undid a conflicting patch that had been applied since your first version
* removed a number of useful comments from the code

I cleaned it up and applied anyway, but generally we expect a higher
quality standard for patches that are claimed to be ready to apply.

regards, tom lane


From: Volkan YAZICI <yazicivo(at)ttmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Configurable Penalty Costs for Levenshtein
Date: 2008-04-04 05:44:32
Message-ID: 87od8q9nsv.fsf@alamut.mobiliz.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Thu, 03 Apr 2008, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> Volkan YAZICI <yazicivo(at)ttmail(dot)com> writes:
>> Sorry for the delay, but the reply of Tom didn't reach me. I've modified
>> the patch according to Tom's comments. I hope I am not too late.
>
> Applied after considerable revision. This patch:
>
> * introduced a memory stomp that was not there before (I strongly
> recommend testing C code in an --enable-cassert build)
> * added a user-visible feature without documenting it
> * undid a conflicting patch that had been applied since your first version
> * removed a number of useful comments from the code
>
> I cleaned it up and applied anyway, but generally we expect a higher
> quality standard for patches that are claimed to be ready to apply.

Thanks so much for your kindness. Please don't hesistate to reject the
patch next time by dropping me an email with the above lines mentioning
about your considerations, and I'll happily fix it at my best and resend
it. I don't want to interrupt your work with such trivial stuff.

Regards.