Subject: | algorithm doesn't always find the longest string |
Date: | Fri, 15 Oct 2010 11:52:41 -0500 |
To: | bug-String-LCSS [...] rt.cpan.org |
From: | James Edwards <jedwards [...] mail.utexas.edu> |
I hate to burst your bubble, but I was working on a LCSS algorithm of my own
and while comparing it to String::LCSS I found a bug in it.
Perl: 5.10.1
String::LCSS: 0.12
OS: Windows 7 Ultimate (using cygwin)
Code:
-------------------------------------------------------------------------------------------------------------------------------------
use String::LCSS;
$result = String::LCSS::lcss("the quick brown fox jumped over the lazy dog",
"I saw a quick brown fox and jumped over the lazy dog");
print "$result\n";
-------------------------------------------------------------------------------------------------------------------------------------
Output:
quick brown fox
Bug:
the output should be ' jumped over the lazy dog'
I have my own algorithm that is working, so I will probably release it in
another package.
Let me know if you have any questions--
Andy