Skip Menu |

This queue is for tickets about the Text-Levenshtein CPAN distribution.

Report information
The Basics
Id: 42459
Status: resolved
Priority: 0/
Queue: Text-Levenshtein

People
Owner: NEILB [...] cpan.org
Requestors: jamesk.au [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.07

Attachments


Subject: Wrong Levenshtein distance reported
Date: Fri, 16 Jan 2009 16:13:59 +1100
To: bug-Text-Levenshtein [...] rt.cpan.org
From: "James King" <jamesk.au [...] gmail.com>
I am calling fastdistance with these parameters: print fastdistance("Distinction courses", "Distinction Courses"); The value printed is 13, not 1, as might be expected. The only difference between the strings is the capitalisation of the letter C in the second word (i.e. one substitution). The value calculated appears to be equal to the number of identical characters preceding the different character plus one. If the capital "C" in the second string is changed to a lowercase "d", the value printed is still 13. If the capital "C" in the second string is instead changed to a lowercase "c" and the "O" is capitalised instead, the value increases to 14. Running Perl v5.10.0 built for MSWin32-x86-multi-thread under Vista Home Premium SP1. I have tried v 0.05 as well as v 0.06_01 of Text::Levenshtein and the result is the same. I am amazed that no one else has encountered (and reported) this since 2004. Kind regards James King
From: reinpost [...] win.tue.nl
There were obvious bugs in both distance() and fastdistance(). A patch is attached. I have extended the tests with your case and a few more, but the result still hasn't been tested very well. Text::LevenshteinXS succeeds on these cases. I'll see if I can email the author.
Subject: Text-Levenshtein-0.05-2bugfixes.diff-urd

Message body not shown because it is not plain text.

From: berka
On Mon Jan 11 05:17:53 2010, rpost wrote: Show quoted text
> There were obvious bugs in both distance() and fastdistance(). A patch > is attached. I have extended the tests with your case and a few more, > but the result still hasn't been tested very well. Text::LevenshteinXS > succeeds on these cases. > > I'll see if I can email the author.
Any luck on contacting the author on this? I've notice he recently fixed similar bug in distance() in developer version v0.06_01.
Fixed in 0.07 -- thanks. Neil