0.7 is ok, 0.6 is too random
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 16 Nov 2023 14:15:55 +0000 (15:15 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 16 Nov 2023 14:15:55 +0000 (15:15 +0100)
upari.pl

index 7720bc2..a189fe7 100755 (executable)
--- a/upari.pl
+++ b/upari.pl
@@ -66,12 +66,12 @@ sub candidates {
 =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;
 }
@@ -123,9 +123,8 @@ foreach my $nr ( 1 .. 4 ) {
 
 
 
-#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->{_} }, $/;
@@ -152,7 +151,7 @@ foreach my $id ( sort 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 ) {