Subject: | adistr() does not return an array of relative edit distances |
#!/usr/bin/perl -w
# see below for version information
# -IAN! idallen@idallen.ca
use strict;
use String::Approx 'adistr';
my @strings = qw( one two three four five six seven eight nine );
# I expected the code below to return a list of floating-point relative
# edit distances; instead, I get a list of integer edit distances:
#
my @matches = &adistr("pattern", @strings);
print "@matches\n";
# The code below works correctly, returning a reference to an array of
# floating-point edit distances:
#
my $matches = &adistr("pattern", \@strings);
print "@{$matches}\n";
__END__
OUTPUT:
-6 -6 -5 -6 -6 -7 -5 -6 -6
-0.857142857142857 -0.857142857142857 -0.714285714285714 -0.857142857142857 -0.857142857142857 -1 -0.714285714285714 -0.857142857142857 -0.857142857142857
PERL:
This is perl, v5.6.1 built for i386-linux
LINUX Mandrake 8.2:
Linux elm 2.4.18-8.1mdk #1 Tue Jul 16 09:11:08 EDT 2002 i686 unknown
String::Approx VERSION:
Major release 3.
2003-05-12 perl v5.6.1 Approx(3)
/usr/lib/perl5/site_perl/5.6.1/i386-linux/String/Approx.pm
package String::Approx;
$VERSION = '3.20';