Subject: | Wrong distance computed |
The distance returned by distance("sebastian","sebastien") is 8. It
should be 1...
Commenting out these parts fixes the problem
$d[0][0]=0;
foreach my $i (1 .. $n) {
# if ($i != $n && substr($s,$i) eq substr($t,$i)) {
# push @result,$i;next;
# }
$d[$i][0]=$i;
}
foreach my $j (1 .. $m) {
# if ($j != $m && substr($s,$j) eq substr($t,$j)) {
# push @result,$j;next;
# }
$d[0][$j]=$j;
}