Lp 1943168: Add Marc Stream Importer Match Quality Ratio Options
authorJason Stephenson <jason@sigio.com>
Thu, 9 Sep 2021 17:20:29 +0000 (13:20 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 01:10:28 +0000 (21:10 -0400)
Add options to specify the match quality ratio when running
marc_stream_importer.pl.  There are separate options for bibs and
authorities:

   --bib-match-quality-ratio=f
   --auth-match-quality-ratio=f

They take floating point arguments and correspond to the similar
option in the Vandelay import screen.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/support-scripts/marc_stream_importer.pl.in

index 4f2a1df..455835e 100755 (executable)
@@ -75,10 +75,12 @@ my $bib_import_no_match;
 my $bib_auto_overlay_exact;
 my $bib_auto_overlay_1match;
 my $bib_auto_overlay_best_match;
+my $bib_match_quality_ratio;
 my $auth_import_no_match;
 my $auth_auto_overlay_exact;
 my $auth_auto_overlay_1match;
 my $auth_auto_overlay_best_match;
+my $auth_match_quality_ratio;
 
 # deprecated options;  these map to their bib_* equivalents
 my $import_no_match;
@@ -118,10 +120,12 @@ GetOptions(
     'bib-auto-overlay-exact'       => \$bib_auto_overlay_exact,
     'bib-auto-overlay-1match'      => \$bib_auto_overlay_1match,
     'bib-auto-overlay-best-match'  => \$bib_auto_overlay_best_match,
+    'bib-match-quality-ratio=f' => \$bib_match_quality_ratio,
     'auth-import-no-match'         => \$auth_import_no_match,
     'auth-auto-overlay-exact'      => \$auth_auto_overlay_exact,
     'auth-auto-overlay-1match'     => \$auth_auto_overlay_1match,
     'auth-auto-overlay-best-match' => \$auth_auto_overlay_best_match,
+    'auth-match-quality-ratio=f' => \$auth_match_quality_ratio,
     'help'                  => \$help,
     'net-server-config=s'   => \$net_server_conf,
     'port=i'                => \$port
@@ -189,10 +193,12 @@ sub usage {
     --bib-auto-overlay-exact
     --bib-auto-overlay-1match
     --bib-auto-overlay-best-match
+    --bib-match-quality-ratio
     --auth-import-no-match
     --auth-auto-overlay-exact
     --auth-auto-overlay-1match
     --auth-auto-overlay-best-match
+    --auth-match-quality-ratio
 
         Bib and auth import options which map directly to Vandelay import 
         options.  
@@ -289,11 +295,13 @@ sub compile_vandelay_ops {
         $vl_ops->{auto_overlay_exact} = $auth_auto_overlay_exact;
         $vl_ops->{auto_overlay_1match} = $auth_auto_overlay_1match;
         $vl_ops->{auto_overlay_best_match} = $auth_auto_overlay_best_match;
+        $vl_ops->{match_quality_ratio} = $auth_match_quality_ratio;
     } else {
         $vl_ops->{import_no_match} = $bib_import_no_match;
         $vl_ops->{auto_overlay_exact} = $bib_auto_overlay_exact;
         $vl_ops->{auto_overlay_1match} = $bib_auto_overlay_1match;
         $vl_ops->{auto_overlay_best_match} = $bib_auto_overlay_best_match;
+        $vl_ops->{match_quality_ratio} = $bib_match_quality_ratio;
     }
 
     # Default to exact match only if not other strategy is selected.