Received: from mail1.hub.org (webmail.hub.org [216.126.85.1]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f72H17f69291 for ; Thu, 2 Aug 2001 13:01:07 -0400 (EDT) (envelope-from oleg@sai.msu.su) Received: from ra.sai.msu.su (ra.sai.msu.su [158.250.29.2]) by mail1.hub.org (8.11.3/8.11.1) with ESMTP id f72Gajo62398 for ; Thu, 2 Aug 2001 12:36:45 -0400 (EDT) (envelope-from oleg@sai.msu.su) Received: from ra (ra [158.250.29.2]) by ra.sai.msu.su (8.9.3/8.9.3) with ESMTP id TAA27886; Thu, 2 Aug 2001 19:16:29 +0300 (GMT) Date: Thu, 2 Aug 2001 19:16:29 +0300 (GMT) From: Oleg Bartunov X-X-Sender: To: Tom Lane cc: Josh Berkus , Joe Conway , Bruce Momjian , Subject: Re: Fuzzy matching? In-Reply-To: <24625.996610191@sss.pgh.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200108/15 X-Sequence-Number: 4236 I have C-codes which implement Levenstein Distance Algorithms Here is a header for soe info: // Levenstein Distance Algorithms Module // // Contains functions to do "Inexact Alphanumeric Comparisons". The original // concept for this code came from "The C Users Journal", May 1991, starting // on page 127. The author was Hans Z. Zwakenberg. // // These routines have been modified so they do not need to use double // subscripted arrays in the CUJ code. An additional function was created to // "look up" a word from a list, returning the most likely matches. // // Written initailly by R. Bruce Roberts, MCI Systems Engineering, 1/7/93 // Compiled with Borland C++, V3.1 // It's compiled and works well. Don't know about license but it's published and it's possible to ask author directly zen:~/app/algo/dist/ldist$ ./test simple sample Returns 'Levenstein Distance' of two strings on command line. Determining Distance for simple and sample. Length is limited to 40 characters. Words are alike, L Distance is 1, Threshold was 3. PLease let me know if you need it. I thought about implementing the same feature as Google has into our OpenFTS search Regards, Oleg On Tue, 31 Jul 2001, Tom Lane wrote: > "Josh Berkus" writes: > > I'm quite interested, myself. How difficult is it for somebody that > > doesn't program C to attach a function from the Contrib directory? > > Run the install script. > > > If it's not very difficult, then I'd recommend putting metaphone in > > /contrib, and levenstein in the backend. My reasoning is that > > levenstein is useful for all roman alphabets, but metaphone is not so > > useful for non-english versions of postgres. > > Our usual practice with stuff of uncertain usefulness has been to stick > it in contrib for awhile and see if anyone uses it. If there's > sufficient interest, we'll promote it to mainstream in a future release. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://www.postgresql.org/search.mpl > Regards, Oleg _____________________________________________________________ Oleg Bartunov, sci.researcher, hostmaster of AstroNet, Sternberg Astronomical Institute, Moscow University (Russia) Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(095)939-16-83, +007(095)939-23-83