aboutsummaryrefslogtreecommitdiffstats
path: root/pairwise.pl
diff options
context:
space:
mode:
Diffstat (limited to 'pairwise.pl')
-rwxr-xr-xpairwise.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/pairwise.pl b/pairwise.pl
index f721575..693b664 100755
--- a/pairwise.pl
+++ b/pairwise.pl
@@ -3,6 +3,8 @@
use strict;
use warnings;
+use Scalar::Util qw(looks_like_number);
+
die "usage: $0 threshold file […]\n" unless $#ARGV > 0;
my $threshold = shift;
@@ -14,9 +16,11 @@ while (<>) {
chomp;
my @parts = split /,/;
for (my $i=1; $i <= $#headers; $i++) {
- if (defined $parts[$i]) {
+ if (defined $parts[$i] && looks_like_number($parts[$i])) {
+ # print STDERR "#h: $#headers #p: $#parts\n";
+ # print STDERR "parts: @parts\n";
my $similarity = $parts[$i];
- print "$parts[0],$headers[$i]\n" if $similarity >= $threshold;
+ print "$parts[0],$headers[$i]\n" if $similarity > $threshold;
}
}
}