# date1, date2
my $my_008 = $record->field('008');
- $marc{tag008} = $my_008->as_string();# if ($my_008);
+ $marc{tag008} = $my_008->as_string() if ($my_008);
if (defined $marc{tag008}) {
unless (length $marc{tag008} == 40) {
$marc{tag008} = $marc{tag008} . ('|' x (40 - length($marc{tag008})));
#----------------------------------
# static criteria scoring
#----------------------------------
- $marc->{misc_score} = 999;
+ $marc->{misc_score} = 999999999999;
+ # subtract record id if we want older records to win
+ $marc->{misc_score} -= $marc->{id} unless ($conf->{newwins});
+ # handle arbitrary adjustments
+ if ($conf->{'arbitrarily-decrease-score-above'}) {
+ $marc->{misc_score} -= $conf->{'arbitrarily-decrease-score-by'}
+ if ($marc->{id} >= $conf->{'arbitrarily-decrease-score-above'});
+ }
+ if ($conf->{'arbitrarily-decrease-score-below'}) {
+ $marc->{misc_score} -= $conf->{'arbitrarily-decrease-score-by'}
+ if ($marc->{id} <= $conf->{'arbitrarily-decrease-score-below'});
+ }
# -1 if 008 has been padded, -2 if it doesn't exist
if ($marc->{tag008})
{ $marc->{misc_score}-- if ($marc->{tag008} =~ /\|$/) }
print XF "Undefined record at line $count; likely bad XML\n";
return;
}
- print XF "Record ", $marc->{id}, " did not make the cut: ";
- print XF "Missing item_form. " unless ($marc->{item_form});
+ print XF "Record ", $marc->{id}, " excluded: ";
+ print XF "missing item_form; " unless ($marc->{item_form});
unless (defined $marc->{date1})
- { print XF "Missing date1. " }
+ { print XF "missing date1; " }
else
- { print XF "Invalid date1: ", $marc->{date1}, " "
+ { print XF "invalid date1: '", $marc->{date1}, "'; "
unless ($marc->{date1} =~ /\d{4}/); }
- print XF "Missing record_type. " unless ($marc->{record_type});
- print XF "Missing bib_lvl. " unless ($marc->{bib_lvl});
- print XF "Missing title. " unless ($marc->{title});
+ print XF "missing record_type; " unless ($marc->{record_type});
+ print XF "missing bib_lvl; " unless ($marc->{bib_lvl});
+ print XF "missing title " unless ($marc->{title});
print XF "\n";
}
'tag|t=s',
'fingerprints=s',
'scores=s',
+ 'arbitrarily-decrease-score-above=i',
+ 'arbitrarily-decrease-score-below=i',
+ 'arbitrarily-decrease-score-by=i',
+ 'newwins',
'quiet|q',
'help|h',
);
$c->{tag} = 903 unless defined $c->{tag};
$c->{subfield} = 'a' unless defined $c->{subfield};
$c->{marctype} = 'XML' unless defined $c->{marctype};
+ $c->{'arbitrarily-decrease-score-by'} = 0
+ unless defined $c->{'arbitrarily-decrease-score-by'};
if ($c->{prefix}) {
$c->{output} = join('.',$c->{prefix},'fp');
$c->{exception} = join('.',$c->{prefix},'fp','ex');
--scores=LIST Scores to calculate, comma separated
Default: oclc,dlc,num_650,num_tags,enc_level
+ --newwins New record IDs score higher (default is old wins)
--marctype=TYPE Defaults to 'XML'
HELP