Subject: | seemingly incorrect indices returns from aindex |
Date: | Tue, 4 May 2010 16:47:04 -0400 |
To: | bug-String-Approx [...] rt.cpan.org |
From: | Jeremy Leipzig <leipzig [...] gmail.com> |
perl 5.8.8
String-Approx-3.26
#!/usr/bin/perl
use String::Approx 'aindex';
print "correct\n";
testApprox("ATGCTACAATGTGCTCCCCCAACTTGATATTAATAACACTATAGACCACCGCCCCGAAGGGGACGAAAAATGGTTT","ACGAAAAATG");
print "incorrect\n";
testApprox("ACCTTTCTTTTTGGGGTAATTATACTCATCGCGAATATCCTTAAGAGGGCGTTCAGCAGCCAGCTTGCGGCAAAAC","TGCGGCAAAA");
sub testApprox{
my ($s1,$s2)=@_;
my @inputs = ($s1);
my @indices = aindex( $s2, [ "I0", "D0", "S0" ], @inputs );
print $s1."\n";
print ' ' x ($indices[0]);
print $s2."\n";
}