--- trunk/conf/ffcasopisi/perilooksig2marc.pl 2009/08/19 16:24:43 1277 +++ trunk/conf/ffcasopisi/perilooksig2marc.pl 2009/08/27 17:32:11 1278 @@ -1,4 +1,4 @@ -my $pair = +my $signatura = lookup( sub { rec('C') }, 'casopisi','sig', @@ -6,7 +6,7 @@ sub { config ('input collection') . rec('000') } ); -if ( $pair ) { +if ( $signatura ) { ### LEADER @@ -36,6 +36,8 @@ if ( $ldr7 ) { marc_leader('07', $ldr7 ); +} else { + marc_leader('07','s'); } @@ -51,7 +53,7 @@ ### 008 - All materials -marc_fixed('008','00', '010101'); # 00-05 - Date entered on file +marc_fixed('008','00', '090820'); # 00-05 - Date entered on file ## za 008 06 treba i lookup u tablicu gdje postoji podatak o tome jel tekuci casopis ili nije? ## c - Continuing resource currently published @@ -63,13 +65,13 @@ my $d1 = ' '; my $d2 = ' '; -if ( rec('210','d') ) { - if ( rec ('210','d') =~ m#(\d{4}).*?-.*?(\d{4})# ) { +if ( rec('210','c') ) { + if ( rec ('210','c') =~ m#(\d{4}).*?-.*?(\d{4})# ) { $d1 = $1; $d2 = $2; marc_fixed('008','06','d'); } - if ( rec ('210','d') =~ m{(\d{4}).*?-\s*$} ) { + if ( rec ('210','c') =~ m{(\d{4}).*?-\s*$} ) { $d1 = $1; $d2 = '9999'; marc_fixed('008','06','c'); @@ -95,34 +97,33 @@ my $fre; -$fre = ( rec('326') eq '2g' ) ? 'g' : - ( rec('326') eq 'g1' ) ? 'a' : - ( rec('326') eq 'g2' ) ? 'f' : - ( rec('326') eq 'g3' ) ? 't' : - ( rec('326') eq 'g4' ) ? 'q' : - ( rec('326') eq 'g5' ) ? 'z' : - ( rec('326') eq 'g6' ) ? 'b' : - ( rec('326') eq 'g8' ) ? 'b' : - ( rec('326') eq 'g9' ) ? 'm' : - ( rec('326') eq 'm1' ) ? 'm' : - ( rec('326') eq '10' ) ? 'm' : - ( rec('326') eq '11' ) ? 'm' : - ( rec('326') eq 'm2' ) ? 's' : - ( rec('326') eq '19' ) ? 's' : - ( rec('326') eq '20' ) ? 's' : - ( rec('326') eq '24' ) ? 's' : - ( rec('326') eq '26' ) ? 's' : - ( rec('326') eq 'm3' ) ? 'j' : - ( rec('326') eq 't1' ) ? 'w' : - ( rec('326') eq 't2' ) ? 'c' : +$fre = ( rec('326') eq '2g' ) ? 'g' : + ( rec('326') eq 'g1' ) ? 'a' : + ( rec('326') eq 'g2' ) ? 'f' : + ( rec('326') eq 'g3' ) ? 't' : + ( rec('326') eq 'g4' ) ? 'q' : + ( rec('326') eq 'g5' ) ? 'z' : + ( rec('326') eq 'g6' ) ? 'b' : + ( rec('326') eq 'g8' ) ? 'b' : + ( rec('326') eq 'g9' ) ? 'm' : + ( rec('326') eq 'm1' ) ? 'm' : + ( rec('326') eq '10' ) ? 'm' : + ( rec('326') eq '11' ) ? 'm' : + ( rec('326') eq 'm2' ) ? 's' : + ( rec('326') eq '19' ) ? 's' : + ( rec('326') eq '20' ) ? 's' : + ( rec('326') eq '26' ) ? 's' : + ( rec('326') eq 'm3' ) ? 'j' : + ( rec('326') eq 't1' ) ? 'w' : + ( rec('326') eq 't2' ) ? 'c' : ( rec('326') eq 't2us' ) ? 'c' : - ( rec('326') eq 'nr' ) ? ' ' : - ( rec('326') eq 'np' ) ? 'u' : - '|'; + ( rec('326') eq 'nr' ) ? ' ' : + '|' +; marc_fixed('008','18', $fre); # 18 - Frequency - ovo treba popuniti iz polja 326 marc_fixed('008','19', '|'); # 19 - Regularity - # 20 - Undefined, ontains a blank (#) or fill character (|) + # 20 - Undefined, contains a blank (#) or fill character (|) # za polje 008 21 treba lookup u tablicu s kodovima za sf i po, za ostale nadopuniti naknadno my $stype = @@ -135,6 +136,8 @@ if ( $stype ) { marc_fixed('008','21', $stype); # 21 - Type of continuing resource +} else { + marc_fixed('008','21', 'p'); } # 22 - Form of original item - blank # 23 - Form of item @@ -169,9 +172,19 @@ marc('035','a', $id); +my $csigid = lookup( + sub { prefix('HR-ZaFF csig', rec('I') ) }, + 'casopisi','sig', + sub { rec('A') . rec('B') }, + sub { config ('input collection') . rec('000') } + ); + +marc('035','a', $csigid); + + ### 040 # za sve je isti -# treba utvrditi točnu oznaku za ustanovu +# treba utvrditi tocnu oznaku za ustanovu marc('040','a', 'HR-ZaFF' @@ -209,6 +222,19 @@ rec('675','a') ); +marc('080','a', + rec('675','b') +); + +marc('080','a', + rec('675','c') +); + +marc('080','a', + rec('675','d') +); + + ### 210 indikatori # marc_indicators('210', '1',' '); @@ -291,16 +317,20 @@ #warn "a: $a\nb: $b\nc: $c\n"; -$a = $a . '.' if ( ! ( $b || $c) ); -$b = $b . '.' if ( ! $c && $b ) ; +$a = $a . '.' if ( ! ( $b || $c || rec('200','f') ) ); +$a = $a . ' /' if ( ! ($b || $c) && rec('200','f') ); +$b = $b . '.' if ( $b && ! ( $c || rec('200','f') ) ) ; +$b = $b . ' /' if ( $b && ! $c && rec('200','f') ) ; marc('245','a', $a); marc('245','b', $b) if $b; if ( $c ) { - marc('245','c', $c); -} else { + marc('245','c', + suffix('.', $c) + ); +} elsif ( rec('200','f') ) { marc('245','c', - rec('200','f') + suffix('.', rec('200','f') ) ); } @@ -407,8 +437,44 @@ ### 310 - current stated publication frequency # potrebno ujednaciti, koristi se i u polju 008 +#my $fredesc; +# +#$fredesc = ( rec('326') eq '2g' ) ? 'Dvogodišnje' : +# ( rec('326') eq 'g1' ) ? 'Godišnje' : +# ( rec('326') eq 'g2' ) ? 'Polugodišnje' : +# ( rec('326') eq 'g3' ) ? 'Tri broja godišnje' : +# ( rec('326') eq 'g4' ) ? 'Četvrtgodišnje' : +# ( rec('326') eq 'g5' ) ? 'Pet brojeva godišnje' : +# ( rec('326') eq 'g6' ) ? 'Dvomjesečno' : +# ( rec('326') eq 'g8' ) ? 'Osam brojeva godišnje' : +# ( rec('326') eq 'g9' ) ? 'Devet brojeva godišnje' : +# ( rec('326') eq 'm1' ) ? 'Mjesečno' : +# ( rec('326') eq '10' ) ? 'Deset brojeva godišnje' : +# ( rec('326') eq '11' ) ? 'Jedanaest brojeve godišnje' : +# ( rec('326') eq 'm2' ) ? 'Polumjesečno' : +# ( rec('326') eq '19' ) ? 'Devetnaest brojeva godišnje' : +# ( rec('326') eq '20' ) ? 'Dvadeset brojeva godišnje' : +# ( rec('326') eq '26' ) ? 'Dvadeset i šest brojeva godišnje' : +# ( rec('326') eq 'm3' ) ? 'Tri broja mjesečno' : +# ( rec('326') eq 't1' ) ? 'Tjedno' : +# ( rec('326') eq 't2' ) ? 'Polutjedno' : +# ( rec('326') eq 't2us' ) ? 'Polutjedno utorkom u subotom' : +# ( rec('326') eq 'nr' ) ? 'Neredovito' : +# ' ' +#; + +#warn $fredesc; + +my $fredesc = + lookup( + sub { rec('B') }, + 'casopisi','frek', + sub { rec('A') }, + sub { rec('326') }, + ); + marc('310','a', - rec('326') + $fredesc ); ### 321 - former frequency of either an item or an update to an item when a current frequency is contained in field 310 @@ -548,7 +614,7 @@ #} ### 653 indikatori -marc_indicators('653', 0, ' '); +marc_indicators('653', ' ', ' '); ### 653 @@ -580,23 +646,31 @@ ); marc('700','a', - join_with(', ', - rec('702','c'), - rec('702','d') - ) + rec('702','c'), +); + +marc('700','a', + rec('702','e'), ); - #_debug(0); ### 710 indikatori -marc_indicators('710', '2', ' '); +marc_indicators('110', '2', ' '); ### 710 -marc('710','a', +marc('110','a', rec('710','a') ); +marc('110','b', + rec('710','b') +); +if ( rec('710','c') ) { + marc('110','c', + surround('(', ')', rec('710','c')) + ); +} ### 770 indikatori @@ -607,6 +681,10 @@ rec('421','a'), ); +marc('770','x', + rec('421','b') +); + ### 772 indikatori marc_indicators('772', 0, ' '); @@ -614,6 +692,9 @@ marc('772','t', rec('422','a'), ); +marc('772','x', + rec('422','b'), +); ### 773 indikatori @@ -650,6 +731,10 @@ rec('423','a'), ); +marc('777','x', + rec('423','b'), +); + ### 780 indikatori marc_indicators('780', 0, 0); @@ -659,6 +744,10 @@ rec('430','a'), ); +marc('780','x', + rec('430','b'), +); + ### 785 indikatori marc_indicators('785', 0, 0); @@ -667,26 +756,44 @@ marc('785','t', rec('440','a'), ); +marc('785','x', + rec('440','b'), +); + ### 856 marc('856','u', rec('856','u') ); +### 866 + +marc_indicators('866',' ', 0); + +marc('866','a', + rec('992') +); + ### 942 -# -#marc('942','d', -# $pair -#); +marc('942','b', + 'PER' +); -### 992 +marc('942','c', + 'PER' +); -marc('992','a', - rec('992') +marc('942','d', + $signatura ); +marc('942','i', + $signatura +); + + ## polja za probu @@ -734,4 +841,4 @@ # ) # ); -} # pair +} # signatura