14 |
use WebPAC::Normalize::XML; |
use WebPAC::Normalize::XML; |
15 |
use WebPAC::Normalize::Set; |
use WebPAC::Normalize::Set; |
16 |
use WebPAC::Output::TT; |
use WebPAC::Output::TT; |
17 |
|
use WebPAC::Validate; |
18 |
use YAML qw/LoadFile/; |
use YAML qw/LoadFile/; |
19 |
use Getopt::Long; |
use Getopt::Long; |
20 |
use File::Path; |
use File::Path; |
64 |
disable indexing and dump statistics about field and subfield |
disable indexing and dump statistics about field and subfield |
65 |
usage for each input |
usage for each input |
66 |
|
|
67 |
|
=item --validate path/to/validation_file |
68 |
|
|
69 |
|
turn on extra validation of imput records, see L<WebPAC::Validation> |
70 |
|
|
71 |
=back |
=back |
72 |
|
|
73 |
=cut |
=cut |
81 |
my $only_filter; |
my $only_filter; |
82 |
my $force_set = 0; |
my $force_set = 0; |
83 |
my $stats = 0; |
my $stats = 0; |
84 |
|
my $validate_path; |
85 |
|
|
86 |
GetOptions( |
GetOptions( |
87 |
"limit=i" => \$limit, |
"limit=i" => \$limit, |
93 |
"debug" => \$debug, |
"debug" => \$debug, |
94 |
"force-set" => \$force_set, |
"force-set" => \$force_set, |
95 |
"stats" => \$stats, |
"stats" => \$stats, |
96 |
|
"validate=s" => \$validate_path, |
97 |
); |
); |
98 |
|
|
99 |
$config = LoadFile($config); |
$config = LoadFile($config); |
105 |
my $log = _new WebPAC::Common()->_get_logger(); |
my $log = _new WebPAC::Common()->_get_logger(); |
106 |
$log->info( "-" x 79 ); |
$log->info( "-" x 79 ); |
107 |
|
|
108 |
|
my $validate; |
109 |
|
$validate = new WebPAC::Validate( |
110 |
|
path => $validate_path, |
111 |
|
) if ($validate_path); |
112 |
|
|
113 |
my $use_indexer = $config->{use_indexer} || 'hyperestraier'; |
my $use_indexer = $config->{use_indexer} || 'hyperestraier'; |
114 |
if ($stats) { |
if ($stats) { |
115 |
$log->debug("option --stats disables update of indexing engine..."); |
$log->debug("option --stats disables update of indexing engine..."); |
274 |
push @{ $row->{'000'} }, $pos; |
push @{ $row->{'000'} }, $pos; |
275 |
} |
} |
276 |
|
|
277 |
|
|
278 |
|
if ($validate) { |
279 |
|
my @errors = $validate->validate_errors( $row ); |
280 |
|
$log->error( "MFN $mfn validation errors:\n", join("\n", @errors) ) if (@errors); |
281 |
|
} |
282 |
|
|
283 |
|
|
284 |
my $ds; |
my $ds; |
285 |
if ($n) { |
if ($n) { |