|
Lines 75-80
my $num_bad_bibs = 0;
Link Here
|
| 75 |
my %unlinked_headings; |
75 |
my %unlinked_headings; |
| 76 |
my %linked_headings; |
76 |
my %linked_headings; |
| 77 |
my %fuzzy_headings; |
77 |
my %fuzzy_headings; |
|
|
78 |
my %nonlinked_headings; |
| 78 |
my $dbh = C4::Context->dbh; |
79 |
my $dbh = C4::Context->dbh; |
| 79 |
$dbh->{AutoCommit} = 0; |
80 |
$dbh->{AutoCommit} = 0; |
| 80 |
process_bibs( $linker, $bib_limit, $auth_limit, $commit ); |
81 |
process_bibs( $linker, $bib_limit, $auth_limit, $commit ); |
|
Lines 108-116
sub process_bibs {
Link Here
|
| 108 |
|
109 |
|
| 109 |
my $headings_linked = 0; |
110 |
my $headings_linked = 0; |
| 110 |
my $headings_unlinked = 0; |
111 |
my $headings_unlinked = 0; |
|
|
112 |
my $headings_nonlinked = 0; |
| 111 |
my $headings_fuzzy = 0; |
113 |
my $headings_fuzzy = 0; |
| 112 |
for ( values %linked_headings ) { $headings_linked += $_; } |
114 |
for ( values %linked_headings ) { $headings_linked += $_; } |
| 113 |
for ( values %unlinked_headings ) { $headings_unlinked += $_; } |
115 |
for ( values %unlinked_headings ) { $headings_unlinked += $_; } |
|
|
116 |
for ( values %nonlinked_headings ) { $headings_nonlinked += $_; } |
| 114 |
for ( values %fuzzy_headings ) { $headings_fuzzy += $_; } |
117 |
for ( values %fuzzy_headings ) { $headings_fuzzy += $_; } |
| 115 |
|
118 |
|
| 116 |
my $endtime = time(); |
119 |
my $endtime = time(); |
|
Lines 132-137
Number of bibs with errors: $num_bad_bibs
Link Here
|
| 132 |
Number of headings linked: $headings_linked |
135 |
Number of headings linked: $headings_linked |
| 133 |
Number of headings unlinked: $headings_unlinked |
136 |
Number of headings unlinked: $headings_unlinked |
| 134 |
Number of headings fuzzily linked: $headings_fuzzy |
137 |
Number of headings fuzzily linked: $headings_fuzzy |
|
|
138 |
Number of headings not linked: $headings_nonlinked |
| 135 |
_SUMMARY_ |
139 |
_SUMMARY_ |
| 136 |
$summary .= "\n**** Ran in test mode only ****\n" if $test_only; |
140 |
$summary .= "\n**** Ran in test mode only ****\n" if $test_only; |
| 137 |
print $summary; |
141 |
print $summary; |
|
Lines 180-185
_FUZZY_HEADER_
Link Here
|
| 180 |
foreach my $key (@keys) { |
184 |
foreach my $key (@keys) { |
| 181 |
print "$key:\t" . $fuzzy_headings{$key} . " occurrences\n"; |
185 |
print "$key:\t" . $fuzzy_headings{$key} . " occurrences\n"; |
| 182 |
} |
186 |
} |
|
|
187 |
|
| 188 |
print <<_NONLINKED_HEADER_; |
| 189 |
|
| 190 |
Not linked headings (from most frequent to least): |
| 191 |
------------------------------------------------------- |
| 192 |
|
| 193 |
_NONLINKED_HEADER_ |
| 194 |
|
| 195 |
@keys = sort { |
| 196 |
$nonlinked_headings{$b} <=> $nonlinked_headings{$a} |
| 197 |
or "\L$a" cmp "\L$b" |
| 198 |
} keys %nonlinked_headings; |
| 199 |
foreach my $key (@keys) { |
| 200 |
print "$key:\t" . $nonlinked_headings{$key} . " occurrences\n"; |
| 201 |
} |
| 202 |
|
| 183 |
print $summary; |
203 |
print $summary; |
| 184 |
} |
204 |
} |
| 185 |
} |
205 |
} |
|
Lines 203-208
sub process_bib {
Link Here
|
| 203 |
foreach my $key ( keys %{ $results->{'unlinked'} } ) { |
223 |
foreach my $key ( keys %{ $results->{'unlinked'} } ) { |
| 204 |
$unlinked_headings{$key} += $results->{'unlinked'}->{$key}; |
224 |
$unlinked_headings{$key} += $results->{'unlinked'}->{$key}; |
| 205 |
} |
225 |
} |
|
|
226 |
foreach my $key ( keys %{ $results->{'nonlinked'} } ) { |
| 227 |
$nonlinked_headings{$key} += $results->{'nonlinked'}->{$key}; |
| 228 |
} |
| 206 |
foreach my $key ( keys %{ $results->{'linked'} } ) { |
229 |
foreach my $key ( keys %{ $results->{'linked'} } ) { |
| 207 |
$linked_headings{$key} += $results->{'linked'}->{$key}; |
230 |
$linked_headings{$key} += $results->{'linked'}->{$key}; |
| 208 |
} |
231 |
} |
| 209 |
- |
|
|