X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=match_fingerprints;h=dd93d9577bd547a32c7715c30a5da41c43ee71df;hp=c1dbcca214a010337e88e21bb7e9728fd35bb19b;hb=ebb7ad9f114865db720271deacb5d2bec173aba7;hpb=4a0c4485708ab3696bb858a23a1598f3ceab717a diff --git a/match_fingerprints b/match_fingerprints index c1dbcca..dd93d95 100755 --- a/match_fingerprints +++ b/match_fingerprints @@ -14,8 +14,7 @@ my @recs = (); # fingerprints belonging to each record my %seen = (); # records we've already seen my $lastscore = 0; # previous fingerprint's score -my %leads = (); # error-checking hashes -my %subs = (); +my %subs = (); # error-checking hashe open FP, '<', $ARGV[0] or die "Can't open input file: $!\n"; @@ -92,12 +91,12 @@ sub dump_records { # check for dupes and die if they exist die "Collision: dupe sub record $_\n" if $subs{$_}; $subs{$_} = 1; - die "Collision: dupe lead record ", $rec->{id}, "\n" - if $leads{ $rec->{id} }; - $leads{ $rec->{id} } = 1; die "Collision: lead in sub list ", $rec->{id}, "\n" if $subs{ $rec->{id} }; + # we don't want subs below threshold + next if ($_ < $conf->{threshold}); + # still here? output. print OUT $rec->{id}, "\t$_\n" } @@ -113,6 +112,7 @@ sub initialize { my $rc = GetOptions( $c, 'output|o=s', + 'threshold|t=i', 'help|h', ); show_help() unless $rc; @@ -126,11 +126,13 @@ sub initialize { print "Required option: ", join(', ', @missing), " missing!\n"; show_help(); } + + $c->{threshold} = 0 unless $c->{threshold}; } sub show_help { print <