=cut
if ( $#candidates > 0 ) {
- print "XXX candidates before = ",dump( \@candidates ),$/;
+ #print "XXX candidates before = ",dump( \@candidates ),$/;
@candidates = sort {
$b->{s} <=> $a->{s} # hi -> low
or length($b->{key}) <=> length($a->{key})
} @candidates;
- print "XXX candidates after = ",dump( \@candidates ),$/;
+ #print "XXX candidates after = ",dump( \@candidates ),$/;
}
return @candidates;
}
-#foreach my $l ( 0 .. 5 ) { # 0.9 - 0.7 -- 0.6 is too lax
-foreach my $l ( qw( 2 3 4 5 ) ) {
- my $limit = 0.9 - "0.$l";
+# 0.9 - 0.7 -- 0.6 is too lax
+foreach my $limit ( 0.7, 0.6 ) {
warn "XXX limit $limit\n";
print "# total = ",scalar keys %{ $stat->{_} }, $/;
my ( $num, $key_id ) = split(/-/,$id,2);
my @candidates = candidates $num => $key_id, $limit; #, 0.7; # XXX 0.9 too high, 0.8 better, 0.7 too lax
if ( @candidates ) {
- print "MERGE ",scalar @candidates, " $num $key_id ", dump( @candidates ), ' val=', dump( \@val ), $/;
+ print "MERGE ",scalar @candidates, " $limit $num $key_id ", dump( @candidates ), ' val=', dump( \@val ), $/;
my @keys = map { $_->{key} } @candidates;
my $m_id = $id; # "$keys[0]-$key_id";
foreach my $i ( 0 .. $#keys ) {