--- trunk/run.pl 2009/05/28 10:15:20 1198 +++ trunk/run.pl 2009/06/09 21:41:49 1223 @@ -542,7 +542,7 @@ } my $rules = $parser->normalize_rules($database,$input_name); - $log->logwarn("no normalize rules for $database/$input_name") unless $rules; + $log->logwarn("no normalize rules for $database/$input_name", $input_db->input_module->can('normalize') ? " using normalize from input module" : '') unless $rules; $log->debug("parsed normalize rules:\n$rules"); @@ -616,6 +616,8 @@ next; # validation doesn't create any output } + my $ds; + if ($rules) { my $ds = WebPAC::Normalize::data_structure( @@ -635,32 +637,33 @@ }, ); - $log->debug("ds = ", sub { dump($ds) }); + } elsif ( $input_db->input_module->can('normalize') ) { + $ds = $input_db->input_module->normalize( $mfn ); + } - if ( $ds ) { + if ( $ds ) { + $log->debug("ds = ", sub { dump($ds) }); - $store->save_ds( - database => $database, - input => $input_name, - id => $mfn, - ds => $ds, - ) if !$stats; - - $indexer->add( - id => "${input_name}/${mfn}", - ds => $ds, - type => $config->get($indexer_config)->{type}, - ) if $indexer; + $store->save_ds( + database => $database, + input => $input_name, + id => $mfn, + ds => $ds, + ) if !$stats; + + $indexer->add( + id => "${input_name}/${mfn}", + ds => $ds, + type => $config->get($indexer_config)->{type}, + ) if $indexer; - foreach my $out ( @output_modules ) { - $out->add( $mfn, $ds ) if $out->can('add'); - } - - } else { - $log->warn("record $pos didn't produce any output after normalization rules!") unless $marc; + foreach my $out ( @output_modules ) { + $out->add( $mfn, $ds ) if $out->can('add'); } - } + } else { + $log->warn("record $pos didn't produce any output after normalization rules!") unless $marc; + } if ($marc) { my $i = 0;