Recommended by Michele Maenpaa, this adds handling colon and end-punctuation stripping
in subroutine _normalize, and fixes length testing in subroutine _get_match_keys
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
}
}
$key = _normalize($key);
+ if ($component->{'length'}){
+ if (length($key) > $component->{'length'}){
+ $key = _normalize(substr($key,$component->{'offset'},$component{'length'}));
+ }
+ }
}
if ($i == 0) {
push @keys, $key if $key;
# FIXME - default normalizer
sub _normalize {
my $value = uc shift;
+ $value =~ s/.;:,\]\[\)\(\/'"//g;
$value =~ s/^\s+//;
- $value =~ s/^\s+$//;
+ #$value =~ s/^\s+$//;
+ $value =~ s/\s+$//;
$value =~ s/\s+/ /g;
- $value =~ s/[.;,\]\[\)\(\/"']//g;
+ #$value =~ s/[.;,\]\[\)\(\/"']//g;
return $value;
}