flaviusm has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I am using String::LCSS module to find the longest common substring of two strings and I don't get the result I am expecting. Can anybody tell me what am I doing wrong? Thank you.
#!/usr/bin/perl require String::LCSS; $s1 = '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 18 19 20 21 22 23 7 + 24'; $s2 = '1 2 3 4 5 7 8 9 11 12 13 10 14 15 16 17 2 18 19 20 21 22 23 7 2 +4'; $result = String::LCSS::lcss ($s1, $s2); print $result;
I am expecting to get "14 15 16 17 2 18 19 20 21 22 23 7 24" but I get instead " 11 12 13 1"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: longest common substring
by Limbic~Region (Chancellor) on Dec 31, 2007 at 20:13 UTC | |
by lima1 (Curate) on Jan 02, 2008 at 18:41 UTC | |
by Limbic~Region (Chancellor) on Jan 02, 2008 at 19:33 UTC | |
by lima1 (Curate) on Jan 03, 2008 at 07:24 UTC | |
|
Re: longest common substring
by wind (Priest) on Dec 31, 2007 at 20:25 UTC | |
by flaviusm (Acolyte) on Dec 31, 2007 at 21:26 UTC | |
by tye (Sage) on Dec 31, 2007 at 21:41 UTC | |
|
Re: longest common substring
by Khen1950fx (Canon) on Dec 31, 2007 at 21:44 UTC |