There are other popular measures of edit distance, which are calculated using a different set of allowable edit operations. For instance,
use Text::Levenshtein qw(distance); print distance("foo","four"); # prints "2" my @words = qw/ four foo bar /; my @distances = distance("foo",@words); print "@distances"; # prints "2 0 3"
use Algorithm::LCSS qw( LCSS CSS CSS_Sorted ); my $lcss_ary_ref = LCSS( \@SEQ1, \@SEQ2 ); # ref to array my $lcss_string = LCSS( $STR1, $STR2 ); # string my $css_ary_ref = CSS( \@SEQ1, \@SEQ2 ); # ref to array of arrays my $css_str_ref = CSS( $STR1, $STR2 ); # ref to array of strings my $css_ary_ref = CSS_Sorted( \@SEQ1, \@SEQ2 ); # ref to array of arrays my $css_str_ref = CSS_Sorted( $STR1, $STR2 ); # ref to array of strings