request a new feature in fuzzystrmatch

Started by Liming Hualmost 13 years ago61 messageshackers
Jump to latest
#1Liming Hu
dawninghu@gmail.com

Hi,

I am studying your levenshtein edit distance contribution in Postgresql.

Can we add Levenshtein-Damerau edit distance since it is used in
spelling checker
instead of levenshtein edit distance?

Levenshtein-Damerau edit distance C source code:
http://stackoverflow.com/questions/10727174/dameraulevenshtein-distance-edit-distance-with-transposition-c-implementation.

Thanks,

Liming

--
Liming Hu
cell: (435)-512-4190
Seattle Washington

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

#2Liming Hu
dawninghu@gmail.com
In reply to: Liming Hu (#1)
Fwd: request a new feature in fuzzystrmatch

---------- Forwarded message ----------
From: Liming Hu <dawninghu@gmail.com>
Date: Thu, May 16, 2013 at 5:41 PM
Subject: request a new feature in fuzzystrmatch
To: pgsql-hackers@postgresql.org

Hi,

I am studying your levenshtein edit distance contribution in Postgresql.

Can we add Levenshtein-Damerau edit distance since it is used in
spelling checker
instead of levenshtein edit distance?

Levenshtein-Damerau edit distance C source code:
http://stackoverflow.com/questions/10727174/dameraulevenshtein-distance-edit-distance-with-transposition-c-implementation.

Thanks,

Liming

--
Liming Hu
cell: (435)-512-4190
Seattle Washington

--
Liming Hu
cell: (435)-512-4190
Seattle Washington

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

#3Atri Sharma
atri.jiit@gmail.com
In reply to: Liming Hu (#1)
Re: request a new feature in fuzzystrmatch

Sent from my iPad

On 17-May-2013, at 6:11, Liming Hu <dawninghu@gmail.com> wrote:

Hi,

I am studying your levenshtein edit distance contribution in Postgresql.

Can we add Levenshtein-Damerau edit distance since it is used in
spelling checker
instead of levenshtein edit distance?

Levenshtein-Damerau edit distance C source code:
http://stackoverflow.com/questions/10727174/dameraulevenshtein-distance-edit-distance-with-transposition-c-implementation.

Could you give some use cases for the same, where the proposed feature does better than the current functionalities?

Regards,

Atri

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

#4Liming Hu
dawninghu@gmail.com
In reply to: Atri Sharma (#3)
Re: request a new feature in fuzzystrmatch

Hi Atri,

Thanks for the quick response.

levenshtein edit distance defines operations of: insertion, deletion, modification.
Levenshtein-Damerau edit distance defines operations of: insertion, deletion, modification
and transposition (
it will be two operations in levenshtein edit distance:
one deletion, and one insertion,
).

In spelling checker/corrector, i.e.
levenshtein('cta', 'cat') will return 2.
but Levenshtein-Damerau('cta', 'cat') will return 1.
if the maximum error is 1, we can not get 'cat'.

In practice, Levenshtein-Damerau is more widely used than Levenshtein.
I believe you notice "Google automated search suggestions", they use
Levenshtein-Damerau.

Thanks,

Liming

On 5/17/2013 3:00 AM, Atri Sharma wrote:

Sent from my iPad

On 17-May-2013, at 6:11, Liming Hu <dawninghu@gmail.com> wrote:

Hi,

I am studying your levenshtein edit distance contribution in Postgresql.

Can we add Levenshtein-Damerau edit distance since it is used in
spelling checker
instead of levenshtein edit distance?

Levenshtein-Damerau edit distance C source code:
http://stackoverflow.com/questions/10727174/dameraulevenshtein-distance-edit-distance-with-transposition-c-implementation.

Could you give some use cases for the same, where the proposed feature does better than the current functionalities?

Regards,

Atri

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

#5Liming Hu
dawninghu@gmail.com
In reply to: Liming Hu (#4)
Re: request a new feature in fuzzystrmatch

Hi Atri,

I also talked to the author of fuzzystrmatch, he also thinks it is a
good feature.
Thanks,

Liming

On 5/17/2013 8:21 AM, Liming Hu wrote:

Hi Atri,

Thanks for the quick response.

levenshtein edit distance defines operations of: insertion, deletion,
modification.
Levenshtein-Damerau edit distance defines operations of: insertion,
deletion, modification
and transposition (
it will be two operations in levenshtein edit distance:
one deletion, and one insertion,
).

In spelling checker/corrector, i.e.
levenshtein('cta', 'cat') will return 2.
but Levenshtein-Damerau('cta', 'cat') will return 1.
if the maximum error is 1, we can not get 'cat'.

In practice, Levenshtein-Damerau is more widely used than Levenshtein.
I believe you notice "Google automated search suggestions", they use
Levenshtein-Damerau.

Thanks,

Liming

On 5/17/2013 3:00 AM, Atri Sharma wrote:

Sent from my iPad

On 17-May-2013, at 6:11, Liming Hu <dawninghu@gmail.com> wrote:

Hi,

I am studying your levenshtein edit distance contribution in
Postgresql.

Can we add Levenshtein-Damerau edit distance since it is used in
spelling checker
instead of levenshtein edit distance?

Levenshtein-Damerau edit distance C source code:
http://stackoverflow.com/questions/10727174/dameraulevenshtein-distance-edit-distance-with-transposition-c-implementation.

Could you give some use cases for the same, where the proposed
feature does better than the current functionalities?

Regards,

Atri

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

#6Atri Sharma
atri.jiit@gmail.com
In reply to: Liming Hu (#4)
Re: request a new feature in fuzzystrmatch

On Fri, May 17, 2013 at 8:51 PM, Liming Hu <dawninghu@gmail.com> wrote:

Hi Atri,

Thanks for the quick response.

levenshtein edit distance defines operations of: insertion, deletion,
modification.
Levenshtein-Damerau edit distance defines operations of: insertion,
deletion, modification
and transposition (
it will be two operations in levenshtein edit distance:
one deletion, and one insertion,
).

In spelling checker/corrector, i.e.
levenshtein('cta', 'cat') will return 2.
but Levenshtein-Damerau('cta', 'cat') will return 1.
if the maximum error is 1, we can not get 'cat'.

In practice, Levenshtein-Damerau is more widely used than Levenshtein.
I believe you notice "Google automated search suggestions", they use
Levenshtein-Damerau.

Sounds interesting. How can we build this over our current
implementation, or do we need to build it from scratch?

Regards,

Atri

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

#7Liming Hu
dawninghu@gmail.com
In reply to: Atri Sharma (#6)
Re: request a new feature in fuzzystrmatch

On 5/17/2013 8:23 AM, Atri Sharma wrote:

On Fri, May 17, 2013 at 8:51 PM, Liming Hu <dawninghu@gmail.com> wrote:

Hi Atri,

Thanks for the quick response.

levenshtein edit distance defines operations of: insertion, deletion,
modification.
Levenshtein-Damerau edit distance defines operations of: insertion,
deletion, modification
and transposition (
it will be two operations in levenshtein edit distance:
one deletion, and one insertion,
).

In spelling checker/corrector, i.e.
levenshtein('cta', 'cat') will return 2.
but Levenshtein-Damerau('cta', 'cat') will return 1.
if the maximum error is 1, we can not get 'cat'.

In practice, Levenshtein-Damerau is more widely used than Levenshtein.
I believe you notice "Google automated search suggestions", they use
Levenshtein-Damerau.

Sounds interesting. How can we build this over our current
implementation, or do we need to build it from scratch?

Regards,

Atri

I know how to write the code, but just need approval of accepting into
the new version.

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

#8Atri Sharma
atri.jiit@gmail.com
In reply to: Liming Hu (#7)
Re: request a new feature in fuzzystrmatch

On Fri, May 17, 2013 at 8:56 PM, Liming Hu <dawninghu@gmail.com> wrote:

On 5/17/2013 8:23 AM, Atri Sharma wrote:

On Fri, May 17, 2013 at 8:51 PM, Liming Hu <dawninghu@gmail.com> wrote:

Hi Atri,

Thanks for the quick response.

levenshtein edit distance defines operations of: insertion, deletion,
modification.
Levenshtein-Damerau edit distance defines operations of: insertion,
deletion, modification
and transposition (
it will be two operations in levenshtein edit distance:
one deletion, and one insertion,
).

In spelling checker/corrector, i.e.
levenshtein('cta', 'cat') will return 2.
but Levenshtein-Damerau('cta', 'cat') will return 1.
if the maximum error is 1, we can not get 'cat'.

In practice, Levenshtein-Damerau is more widely used than Levenshtein.
I believe you notice "Google automated search suggestions", they use
Levenshtein-Damerau.

Sounds interesting. How can we build this over our current
implementation, or do we need to build it from scratch?

Regards,

Atri

I know how to write the code, but just need approval of accepting into the
new version.

Well, acceptance depends largely on the implementation and actual
benefit statistics. I would suggest implementing a basic version and
then demonstrating its potential benefits here. It will lead to
clearer ideas for us and lead to improvements in the implementation.

Regards,

Atri
--
Regards,

Atri
l'apprenant

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

#9Cédric Villemain
cedric@2ndquadrant.com
In reply to: Atri Sharma (#8)
Re: request a new feature in fuzzystrmatch

Hello Liming,

Sounds interesting. How can we build this over our current
implementation, or do we need to build it from scratch?

I know how to write the code, but just need approval of accepting into
the new version.

Well, acceptance depends largely on the implementation and actual
benefit statistics. I would suggest implementing a basic version and
then demonstrating its potential benefits here. It will lead to
clearer ideas for us and lead to improvements in the implementation.

You can have a look at this page:
http://wiki.postgresql.org/wiki/Submitting_a_Patch

--
Cédric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - Développement, Expertise et Formation

#10Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Liming Hu (#5)
Re: request a new feature in fuzzystrmatch

Liming Hu escribió:

Hi Atri,

I also talked to the author of fuzzystrmatch, he also thinks it is a
good feature.

Yeah, I heard our fuzzystrmatch module being talked down a decade ago
for not considering transpositions, so +1 for getting it patched.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

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

#11Atri Sharma
atri.jiit@gmail.com
In reply to: Alvaro Herrera (#10)
Re: request a new feature in fuzzystrmatch

On Fri, May 17, 2013 at 9:29 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:

Liming Hu escribió:

Hi Atri,

I also talked to the author of fuzzystrmatch, he also thinks it is a
good feature.

Yeah, I heard our fuzzystrmatch module being talked down a decade ago
for not considering transpositions, so +1 for getting it patched.

That is awesome then. The example Liming provided is itself pretty
interesting and promising.

Regards,

Atri

--
Regards,

Atri
l'apprenant

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

#12Liming Hu
dawninghu@gmail.com
In reply to: Atri Sharma (#11)
Re: request a new feature in fuzzystrmatch

Actually it is easy for me to just modify the code, and use it for me
case, I would like to contribute to the
community. I will write a basic implementation first.

On Fri, May 17, 2013 at 9:10 AM, Atri Sharma <atri.jiit@gmail.com> wrote:

On Fri, May 17, 2013 at 9:29 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:

Liming Hu escribió:

Hi Atri,

I also talked to the author of fuzzystrmatch, he also thinks it is a
good feature.

Yeah, I heard our fuzzystrmatch module being talked down a decade ago
for not considering transpositions, so +1 for getting it patched.

That is awesome then. The example Liming provided is itself pretty
interesting and promising.

Regards,

Atri

--
Regards,

Atri
l'apprenant

--
Liming Hu
cell: (435)-512-4190
Seattle Washington

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

#13Josh Berkus
josh@agliodbs.com
In reply to: Liming Hu (#1)
Re: request a new feature in fuzzystrmatch

Can we add Levenshtein-Damerau edit distance since it is used in
spelling checker
instead of levenshtein edit distance?

Patches welcome! You, too, can be a PostgreSQL contributor.

However, you will need to preserve the ability of users to use the old
levenshtien algorithm as well, for backwards-compatibility. Shouldn't
be hard, just add a new function called levenshtiend().

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

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

#14Liming Hu
dawninghu@gmail.com
In reply to: Josh Berkus (#13)
Re: request a new feature in fuzzystrmatch

On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:

Can we add Levenshtein-Damerau edit distance since it is used in
spelling checker
instead of levenshtein edit distance?

Patches welcome! You, too, can be a PostgreSQL contributor.

However, you will need to preserve the ability of users to use the old
levenshtien algorithm as well, for backwards-compatibility. Shouldn't
be hard, just add a new function called levenshtiend().

I am working on it, I will make it this weekend project.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

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

--
Liming Hu
cell: (435)-512-4190
Seattle Washington

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

#15Liming Hu
dawninghu@gmail.com
In reply to: Liming Hu (#14)
Re: request a new feature in fuzzystrmatch

On 5/17/2013 12:39 PM, Liming Hu wrote:

On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:

Can we add Levenshtein-Damerau edit distance since it is used in
spelling checker
instead of levenshtein edit distance?

Patches welcome! You, too, can be a PostgreSQL contributor.

However, you will need to preserve the ability of users to use the old
levenshtien algorithm as well, for backwards-compatibility. Shouldn't
be hard, just add a new function called levenshtiend().

I am working on it, I will make it this weekend project.

I have done that. and put the code at github:
https://github.com/liminghu/fuzzystrmatch

liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo cp fuzzystrmatch.so
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo /etc/init.d/postgresql restart

* Restarting PostgreSQL 9.1 database server

[ OK ]

select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
CREATE EXTENSION fuzzystrmatch;

********** Error **********

ERROR: could not load library
"/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
damerau_levenshtein_internal_noncompatible

Any one can help me on this? Thanks.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

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

--
Liming Hu
cell: (435)-512-4190
Seattle Washington

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

#16Atri Sharma
atri.jiit@gmail.com
In reply to: Liming Hu (#15)
Re: request a new feature in fuzzystrmatch

On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:

On 5/17/2013 12:39 PM, Liming Hu wrote:

On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:

Can we add Levenshtein-Damerau edit distance since it is used in
spelling checker
instead of levenshtein edit distance?

Patches welcome! You, too, can be a PostgreSQL contributor.

However, you will need to preserve the ability of users to use the old
levenshtien algorithm as well, for backwards-compatibility. Shouldn't
be hard, just add a new function called levenshtiend().

I am working on it, I will make it this weekend project.

I have done that. and put the code at github:
https://github.com/liminghu/fuzzystrmatch

liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo cp fuzzystrmatch.so
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo /etc/init.d/postgresql restart

* Restarting PostgreSQL 9.1 database server

[ OK ]

select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
CREATE EXTENSION fuzzystrmatch;

********** Error **********

ERROR: could not load library
"/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
damerau_levenshtein_internal_noncompatible

Any one can help me on this? Thanks.

The system is not able to find the required library, and I dont think
using cp to place the library is a very good idea.Did you run Make
Install after you added your work in the Makefile?

Regards,

Atri

--
Regards,

Atri
l'apprenant

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

#17Liming Hu
dawninghu@gmail.com
In reply to: Atri Sharma (#16)
Re: request a new feature in fuzzystrmatch

On 5/17/2013 9:10 PM, Atri Sharma wrote:

On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:

On 5/17/2013 12:39 PM, Liming Hu wrote:

On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:

Can we add Levenshtein-Damerau edit distance since it is used in
spelling checker
instead of levenshtein edit distance?

Patches welcome! You, too, can be a PostgreSQL contributor.

However, you will need to preserve the ability of users to use the old
levenshtien algorithm as well, for backwards-compatibility. Shouldn't
be hard, just add a new function called levenshtiend().

I am working on it, I will make it this weekend project.

I have done that. and put the code at github:
https://github.com/liminghu/fuzzystrmatch

liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo cp fuzzystrmatch.so
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo /etc/init.d/postgresql restart

* Restarting PostgreSQL 9.1 database server

[ OK ]

select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
CREATE EXTENSION fuzzystrmatch;

********** Error **********

ERROR: could not load library
"/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
damerau_levenshtein_internal_noncompatible

Any one can help me on this? Thanks.

The system is not able to find the required library, and I dont think
using cp to place the library is a very good idea.Did you run Make
Install after you added your work in the Makefile?

I did not run make install. I am running a stable postgresql in my
laptop, I do not
want to reinstall everything, just want to try this contribution. I am
afraid
reinstall it will destroy my configurations, and databases, just do not
want to mess up.
did you see any thing wrong:
https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql
https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql
https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c
https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c
https://github.com/liminghu/fuzzystrmatch/blob/master/levenshtein.c

Thanks,

Liming

Regards,

Atri

--
Regards,

Atri
l'apprenant

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

#18Atri Sharma
atri.jiit@gmail.com
In reply to: Liming Hu (#17)
Re: request a new feature in fuzzystrmatch

Sent from my iPad

On 18-May-2013, at 10:00, Liming Hu <dawninghu@gmail.com> wrote:

On 5/17/2013 9:10 PM, Atri Sharma wrote:

On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:

On 5/17/2013 12:39 PM, Liming Hu wrote:

On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:

Can we add Levenshtein-Damerau edit distance since it is used in
spelling checker
instead of levenshtein edit distance?

Patches welcome! You, too, can be a PostgreSQL contributor.

However, you will need to preserve the ability of users to use the old
levenshtien algorithm as well, for backwards-compatibility. Shouldn't
be hard, just add a new function called levenshtiend().

I am working on it, I will make it this weekend project.

I have done that. and put the code at github:
https://github.com/liminghu/fuzzystrmatch

liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo cp fuzzystrmatch.so
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo /etc/init.d/postgresql restart

* Restarting PostgreSQL 9.1 database server

[ OK ]

select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
CREATE EXTENSION fuzzystrmatch;

********** Error **********

ERROR: could not load library
"/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
damerau_levenshtein_internal_noncompatible

Any one can help me on this? Thanks.

The system is not able to find the required library, and I dont think
using cp to place the library is a very good idea.Did you run Make
Install after you added your work in the Makefile?

I did not run make install. I am running a stable postgresql in my laptop, I do not
want to reinstall everything, just want to try this contribution. I am afraid
reinstall it will destroy my configurations, and databases, just do not want to mess up.
did you see any thing wrong:
https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql
https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql
https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c
https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c
https://github.com/liminghu/fuzzystrmatch/blob/master/

You need not reinstall your entire database for installing/re installing an extension.Running make install from the extension's directory(after placing it in /contrib of a postgres database source directory) will install the extension in your current database without breaking anything.

Regards,

Atri

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

#19Liming Hu
dawninghu@gmail.com
In reply to: Atri Sharma (#18)
Re: request a new feature in fuzzystrmatch

On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri.jiit@gmail.com> wrote:

Sent from my iPad

On 18-May-2013, at 10:00, Liming Hu <dawninghu@gmail.com> wrote:

On 5/17/2013 9:10 PM, Atri Sharma wrote:

On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:

On 5/17/2013 12:39 PM, Liming Hu wrote:

On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:

Can we add Levenshtein-Damerau edit distance since it is used in
spelling checker
instead of levenshtein edit distance?

Patches welcome! You, too, can be a PostgreSQL contributor.

However, you will need to preserve the ability of users to use the old
levenshtien algorithm as well, for backwards-compatibility. Shouldn't
be hard, just add a new function called levenshtiend().

I am working on it, I will make it this weekend project.

I have done that. and put the code at github:
https://github.com/liminghu/fuzzystrmatch

liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo cp fuzzystrmatch.so
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo /etc/init.d/postgresql restart

* Restarting PostgreSQL 9.1 database server

[ OK ]

select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
CREATE EXTENSION fuzzystrmatch;

********** Error **********

ERROR: could not load library
"/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
damerau_levenshtein_internal_noncompatible

Any one can help me on this? Thanks.

The system is not able to find the required library, and I dont think
using cp to place the library is a very good idea.Did you run Make
Install after you added your work in the Makefile?

I did not run make install. I am running a stable postgresql in my laptop, I do not
want to reinstall everything, just want to try this contribution. I am afraid
reinstall it will destroy my configurations, and databases, just do not want to mess up.
did you see any thing wrong:
https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql
https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql
https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c
https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c
https://github.com/liminghu/fuzzystrmatch/blob/master/

You need not reinstall your entire database for installing/re installing an extension.Running make install from the extension's directory(after placing it in /contrib of a postgres database source directory) will install the extension in your current database without breaking anything.

You mean:
liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
make install
?

Regards,

Atri

--
Liming Hu
cell: (435)-512-4190
Seattle Washington

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

#20Atri Sharma
atri.jiit@gmail.com
In reply to: Liming Hu (#19)
Re: request a new feature in fuzzystrmatch

Sent from my iPad

On 18-May-2013, at 10:41, Liming Hu <dawninghu@gmail.com> wrote:

On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri.jiit@gmail.com> wrote:

Sent from my iPad

On 18-May-2013, at 10:00, Liming Hu <dawninghu@gmail.com> wrote:

On 5/17/2013 9:10 PM, Atri Sharma wrote:

On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:

On 5/17/2013 12:39 PM, Liming Hu wrote:

On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:

Can we add Levenshtein-Damerau edit distance since it is used in
spelling checker
instead of levenshtein edit distance?

Patches welcome! You, too, can be a PostgreSQL contributor.

However, you will need to preserve the ability of users to use the old
levenshtien algorithm as well, for backwards-compatibility. Shouldn't
be hard, just add a new function called levenshtiend().

I am working on it, I will make it this weekend project.

I have done that. and put the code at github:
https://github.com/liminghu/fuzzystrmatch

liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo cp fuzzystrmatch.so
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo /etc/init.d/postgresql restart

* Restarting PostgreSQL 9.1 database server

[ OK ]

select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
CREATE EXTENSION fuzzystrmatch;

********** Error **********

ERROR: could not load library
"/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
damerau_levenshtein_internal_noncompatible

Any one can help me on this? Thanks.

The system is not able to find the required library, and I dont think
using cp to place the library is a very good idea.Did you run Make
Install after you added your work in the Makefile?

I did not run make install. I am running a stable postgresql in my laptop, I do not
want to reinstall everything, just want to try this contribution. I am afraid
reinstall it will destroy my configurations, and databases, just do not want to mess up.
did you see any thing wrong:
https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql
https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql
https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c
https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c
https://github.com/liminghu/fuzzystrmatch/blob/master/

You need not reinstall your entire database for installing/re installing an extension.Running make install from the extension's directory(after placing it in /contrib of a postgres database source directory) will install the extension in your current database without breaking anything.

You mean:
liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
make install
?

Yes,although,I would run make clean before running make install,just for ensuring that all runs well.

Regards,

Atri

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

#21Liming Hu
dawninghu@gmail.com
In reply to: Atri Sharma (#20)
#22Atri Sharma
atri.jiit@gmail.com
In reply to: Liming Hu (#21)
#23Liming Hu
dawninghu@gmail.com
In reply to: Atri Sharma (#22)
#24Atri Sharma
atri.jiit@gmail.com
In reply to: Liming Hu (#23)
#25Atri Sharma
atri.jiit@gmail.com
In reply to: Liming Hu (#1)
#26Liming Hu
dawninghu@gmail.com
In reply to: Atri Sharma (#25)
#27Atri Sharma
atri.jiit@gmail.com
In reply to: Liming Hu (#26)
#28Liming Hu
dawninghu@gmail.com
In reply to: Atri Sharma (#27)
#29Atri Sharma
atri.jiit@gmail.com
In reply to: Liming Hu (#28)
#30David Fetter
david@fetter.org
In reply to: Cédric Villemain (#9)
#31Liming Hu
dawninghu@gmail.com
In reply to: David Fetter (#30)
#32Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Liming Hu (#31)
#33Liming Hu
dawninghu@gmail.com
In reply to: Alvaro Herrera (#32)
#34Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Liming Hu (#33)
#35Joe Conway
mail@joeconway.com
In reply to: Liming Hu (#33)
#36Liming Hu
dawninghu@gmail.com
In reply to: Joe Conway (#35)
#37Liming Hu
dawninghu@gmail.com
In reply to: Liming Hu (#36)
#38David Fetter
david@fetter.org
In reply to: Liming Hu (#37)
#39Joshua D. Drake
jd@commandprompt.com
In reply to: David Fetter (#38)
#40David Fetter
david@fetter.org
In reply to: Joshua D. Drake (#39)
#41Josh Berkus
josh@agliodbs.com
In reply to: Liming Hu (#1)
#42Josh Berkus
josh@agliodbs.com
In reply to: Liming Hu (#1)
#43Liming Hu
dawninghu@gmail.com
In reply to: Josh Berkus (#42)
#44Joshua D. Drake
jd@commandprompt.com
In reply to: David Fetter (#40)
#45Joe Conway
mail@joeconway.com
In reply to: Liming Hu (#37)
#46Liming Hu
dawninghu@gmail.com
In reply to: Joe Conway (#45)
#47Joe Conway
mail@joeconway.com
In reply to: Liming Hu (#46)
#48Liming Hu
dawninghu@gmail.com
In reply to: Joe Conway (#47)
#49Michael Paquier
michael@paquier.xyz
In reply to: Joe Conway (#47)
#50Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Joe Conway (#47)
#51Josh Berkus
josh@agliodbs.com
In reply to: Liming Hu (#1)
#52Liming Hu
dawninghu@gmail.com
In reply to: Michael Paquier (#49)
#53Liming Hu
dawninghu@gmail.com
In reply to: Alvaro Herrera (#50)
#54Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Liming Hu (#53)
#55Josh Berkus
josh@agliodbs.com
In reply to: David Fetter (#30)
#56Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Josh Berkus (#55)
#57Josh Berkus
josh@agliodbs.com
In reply to: Joe Conway (#35)
#58Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#56)
#59Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Josh Berkus (#57)
#60Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#59)
#61Robert Haas
robertmhaas@gmail.com
In reply to: Michael Paquier (#60)