--- trunk/run.pl 2006/07/04 10:34:15 578 +++ trunk/run.pl 2006/07/05 19:52:45 585 @@ -8,9 +8,9 @@ use WebPAC::Common 0.02; use WebPAC::Lookup; -use WebPAC::Input 0.03; +use WebPAC::Input 0.07; use WebPAC::Store 0.03; -use WebPAC::Normalize; +use WebPAC::Normalize 0.11; use WebPAC::Output::TT; use WebPAC::Validate; use WebPAC::Output::MARC; @@ -233,10 +233,13 @@ my $input_db = new WebPAC::Input( module => $input_module, - code_page => $config->{webpac}->{webpac_encoding}, + encoding => $config->{webpac}->{webpac_encoding}, limit => $limit || $input->{limit}, offset => $offset, - lookup => $lookup, + lookup_coderef => sub { + my $rec = shift || return; + $lookup->add( $rec ); + }, recode => $input->{recode}, stats => $stats, ); @@ -314,12 +317,21 @@ type => $config->{$use_indexer}->{type}, ) if ($indexer && $ds); - $marc->add( - id => $mfn, - fields => [ WebPAC::Normalize::_get_marc_fields() ], - leader => WebPAC::Normalize::marc_leader(), - row => $row, - ) if ($marc); + if ($marc) { + my $i = 0; + + while (my $fields = WebPAC::Normalize::_get_marc_fields( fetch_next => 1 ) ) { + $marc->add( + id => $mfn . ( $i ? "/$i" : '' ), + fields => $fields, + leader => WebPAC::Normalize::marc_leader(), + row => $row, + ); + $i++; + } + + $log->info("Created $i instances of MFN $mfn\n") if ($i > 1); + } $total_rows++; }