--- trunk/run.pl 2006/05/15 18:27:15 512 +++ trunk/run.pl 2006/05/16 15:23:12 516 @@ -14,6 +14,7 @@ use WebPAC::Normalize::XML; use WebPAC::Normalize::Set; use WebPAC::Output::TT; +use WebPAC::Validate; use YAML qw/LoadFile/; use Getopt::Long; use File::Path; @@ -63,6 +64,10 @@ disable indexing and dump statistics about field and subfield usage for each input +=item --validate path/to/validation_file + +turn on extra validation of imput records, see L + =back =cut @@ -76,6 +81,7 @@ my $only_filter; my $force_set = 0; my $stats = 0; +my $validate_path; GetOptions( "limit=i" => \$limit, @@ -87,6 +93,7 @@ "debug" => \$debug, "force-set" => \$force_set, "stats" => \$stats, + "validate=s" => \$validate_path, ); $config = LoadFile($config); @@ -98,6 +105,11 @@ my $log = _new WebPAC::Common()->_get_logger(); $log->info( "-" x 79 ); +my $validate; +$validate = new WebPAC::Validate( + path => $validate_path, +) if ($validate_path); + my $use_indexer = $config->{use_indexer} || 'hyperestraier'; if ($stats) { $log->debug("option --stats disables update of indexing engine..."); @@ -262,6 +274,12 @@ push @{ $row->{'000'} }, $pos; } + + if ($validate) { + my @errors = $validate->validate_errors( $row ); + $log->error( "MFN $mfn validation errors:\n", join("\n", @errors) ) if (@errors); + } + my $ds; if ($n) {