local
[webpac2] / conf / normalize / ff-libri.pl
index aa920a8..a940113 100644 (file)
@@ -4,13 +4,17 @@
 # UNIMARC formatu, sa vi¹estrukim odstupanjima od standarda.
 
 
-## konvertira se ako postoji polje 200^a
+## lookup rezultat za sabrana djela
+my $sabrana;
+
 
+## konvertira se ako postoji polje 200^a
 if ( rec('200','a') ) {
 
 ### LEADER
 
 ## LDR 05 - c = pregledan ; n = new
+## provjeriti za svaku bazu koje polje koristi
 ## 999^aP - SFM
 
 if ( rec('999','a') && rec('999','a') =~ m/(pregledan|P)/i) {
@@ -25,24 +29,42 @@ if ( rec('999','a') && rec('999','a') =~ m/(pregledan|P)/i) {
 
 ## LDR 07 - m - Monograph/item
 
+if ( config() =~ m/fffi/ ) { 
+       $sabrana = 
+               lookup(
+                       sub{ rec('A') },
+                       'fffi','sabrana',
+                       sub { rec('B') },
+                       sub { rec('000') }
+               );
+}
+
+if ( ! $sabrana ) {
        marc_leader('07','m');
+} else {
+       marc_leader('07','c');
+}
 
-## LDR 17 - 3
+## LDR 17 - Encoding level ; 7 - minimal level
        marc_leader('17','7');
 
-## LDR 18 
+## LDR 18 - i - isbd 
        marc_leader('18','i');
 
-## LDR 19 - razjasniti
-# nema vi¹e r, ima #, a, b ili c
+## LDR 19
+# # - Not specified or not applicable; a - Set; b - Part with independent title; c - Part with dependent title 
+
+#if ( ( ! $sabrana ) && ( rec('230') || rec('231') || rec('232') || rec('233') ) ) { 
+#      marc_leader('19','a');
+#}
 
-if ( rec('230') | rec('231') | rec('232') | rec('233') ) {
+if ( ( rec('230') || rec('231') || rec('232') || rec('233') ) ) { 
        marc_leader('19','a');
 }
 
 ### 008 - All materials
 ## dodati sve moguce slucajeve za datum, popuniti ono sto nedostaje
-## ostaviti prazno tamo gdje nema ni¹ta 
+## provjereno: fi
 
 if ( rec('994','c') =~ m/\d{8}/ ) {
        marc_fixed('008','00',
@@ -78,31 +100,43 @@ if ( rec('994','c') =~ m/\d{8}/ ) {
 #);
 
 ## 008 06 - Type of date/Publication status
-## dodati i ostale moguænosti
-## 008 07-10 - Date 1 - iz 210d koji kroz modify postaje 210c
-## srediti sve moguæe upitne godine
+
+## 008 07-10 - Date 1 - 
+## srediti sve moguæe oznake za godine (06)
+## 210d kroz modify postaje 210c
 
 if ( rec('210','c') ) {
-       my $d1;
-       my $d2;
-       if ( rec('210','c') =~ m/\?/ ) {
+       my $d1 = '';
+       my $d2 = '';
+       if ( rec('210','c') =~ m/(\?)/ ) {
                marc_fixed('008','06','q');
+               if ( rec('210','c') =~ m/(\d{2})(--|__)/ ) {
+                       $d1 = $1.'uu';
+               } 
+               if ( rec('210','c') =~ m/(\d{3})(-|_)/ ) {
+                       $d1 = $1.'u';
+               }
+               if ( rec('210','c') =~ m/(\d{4})/ ) {
+                       $d1 = $1;
+               }
+       } elsif ( rec('210','c') =~ m/(\d{4})-/ ) {
+               if ( $sabrana ) { 
+                       marc_fixed('008','06','i');
+               } else {
+                       marc_fixed('008','06','m');
+               }
+               if ( rec('210','c') =~ m/(\d{4})-/ ) {
+                       $d1 = $1;
+                       $d2 = '9999';
+               }
+               if ( rec('210','c') =~ m/-(\d{4})/ ) {
+                       $d2 = $1;
+               }
        } else {
                marc_fixed('008','06','s');
-       }
-       if ( rec('210','c') =~ m/(\d{4})/ ) {
-               $d1 = $1;
-       } else {
-               $d1 = '';
-       }
-       if ( rec('210','c') =~ m/^.*-(\d{4})/ ) {
-               $d2 = $1;
-       } else {
-               $d2 = '',
-       }
-       if ( rec('210','c') =~ m/(\d{2})--/ ) {
-               $d1 = $1.'uu';
-               marc_fixed('008','06','u');
+               if ( rec('210','c') =~ m/(\d{4})/ ) {
+                       $d1 = $1;
+               }
        }
 
        marc_fixed('008','07',$d1);             # 07-10 - Date 1
@@ -207,7 +241,6 @@ if ( frec('10') ne ( frec('290') ) ) {
        marc('020','z',
                rec('10','z')
        );
-                       
 }
 
 #warn( 
@@ -217,9 +250,8 @@ if ( frec('10') ne ( frec('290') ) ) {
 #);
 
 ### 035$
-## Privemeno koristimo 035$6 umjesto 035$9, zato ¹to marclint prijavljuje 9 kao gre¹ku.
-## marc 035a - System Number - Voyagerov ID (001) 
-## polje 035$9 mo¾e sadr¾avati slova i razmake
+## marc 035a - System Number 
+## polje mo¾e sadr¾avati slova i razmake, problem u pretra¾ivanju ako ima zagrade, kako bi trebalo po standardu
 
 marc('035','a',
 join_with('',
@@ -241,20 +273,16 @@ join_with('',
 marc('040','a',
        'HR-ZaFF'
 );
-
 marc('040','b',
        'hrv'
 );
-
 marc('040','c',
        'HR-ZaFF'
 );
-
 marc('040','e',
        'ppiak'
 );
 
-
 ### 041 - indikatori
 ## pretpostavke o indikatorima
 ## 1. Ako postoji polje 300 i ono sadr¾i /Prijevod/ ili /Izv. stv. nasl./, i1 = 1
@@ -264,28 +292,34 @@ marc('040','e',
 ## (ako postoje zagrade pr. 94(=411.16) onda su to pomoæne oznake)
 ## pr. 821.111-2=163.42 je prijevod engleske drame na HR. 
 ## to ima samo za knji¾evna djela, eseje.... 
-## ????
 
 #if ( rec('675') =~ m/\d=\d/ ) ?
 
 if ( 
-       grep( m/[prijevod|prevedeno|izv.*stv.*nasl|izvornik|nas.*izv*]/i, rec('300') ) || 
-       grep( m/[preve|prijevod]/i, rec('200','f')) || 
-       grep( m/[preve|prijevod]/i, rec('200','g'))  
+       grep( m/prijevod/i, rec('300') ) 
+       || grep( m/nasl.*izv/i, rec('300') ) 
+#      ( frec('300') =~ m/Prijevod/ )
+#      || ( rec('300') =~ m/izvorni stvarni naslov/i )
+#      || ( rec('300') =~ m/naslov izvornika/i )
+#      grep( m/[prijevod|stvarni\snaslov]/i, rec('300') ) 
 ) {
        marc_indicators('041', 1, ' ');
-} else {
+       marc_repeatable_subfield('041','a',
+               map { lc($_) } rec('101')
+       );
+} elsif ( 
+       count( rec('101') ) > 1 
+) {
        marc_indicators('041', 0, ' ');
+       marc_repeatable_subfield('041','a',
+               map { lc($_) } rec('101')
+       );
 }
 
-### 041
-## ponovljivo polje (101) konvertira se u ponovljivo potpolje (041a)
-
-#_debug(2);
-
-marc_repeatable_subfield('041','a',
-       map { lc($_) } rec('101')
-);
+       ### 041
+       ## ponovljivo polje (101) konvertira se u ponovljivo potpolje (041a)
+       ## polje se koristi kad ima vi¹e od jednog jezika, ili kad se radi o prijevodu
+       #_debug(2);
 
 #_debug(0);
 
@@ -294,6 +328,7 @@ marc_repeatable_subfield('041','a',
 
 ### 080
 ## 675 podpolja b, c, d ... - ¹to s njima? - provjeriti za svaku bazu
+## fi: abcd
 
 marc('080','a',
        rec('675','a')
@@ -341,6 +376,7 @@ marc('100','a',
 
 ### 111 i 110
 ## konverzija u 110 ili 111 ovisno o postojanju/nepostojanju nekih polja - provjeriti ispise naslova iz svake baze - moguæe su gre¹ke.
+## popraviti interpunkciju
 
 # ovo vrijedi za FFSFB
 if ( rec('710','d') || rec('710','e') || rec('710','f') ) {
@@ -373,29 +409,21 @@ marc_compose('111',
        ),
        '+',')',
 );
-
-
 } else {
-       
-marc_indicators('110', 2, ' ');
-
-marc('110','a',
-       rec('710','a')
-);
-
-marc('110','b',
-       rec('710','b')
-);
-
-       if ( rec('710','c') ) {
-       marc('110','c',
-               surround('(', ')', rec('710','c'))
+       marc_indicators('110', 2, ' ');
+       marc('110','a',
+               rec('710','a')
+       );
+       marc('110','b',
+               rec('710','b')
        );
+       if ( rec('710','c') ) {
+               marc('110','c',
+                       surround('(', ')', rec('710','c'))
+               );
        }
-
 }
 
-
 ### 245 indikatori
 ## i1 = 0 za anonimne publikacije, i1 = 1 ako postoji 700 ili 710
 ## i2 = pretpostavlja se na temelju èlana na poèetku naslova i jezika
@@ -405,7 +433,6 @@ my $i1;
 
 if ( rec('700') || rec('710') ) {
        $i1 = 1;
-
 } else {
        $i1 = 0;
 }
@@ -415,30 +442,28 @@ marc_indicators('245', $i1, 0);
 if ( rec('200','a') =~ m/^Einen / ) {
                marc_indicators('245', $i1, 6);
 } 
-
 if ( rec('200','a') =~ m/^Eine / ) {
                marc_indicators('245', $i1, 5);
 } 
-
-if ( rec('200','a') =~ m/^(Die|Das|Der|Ein|Les|The) / ) {
+if ( rec('200','a') =~ m/^(Die|Das|Der|Ein|Les|Los|The) / ) {
                marc_indicators('245', $i1, 4);
 } 
-
-if ( rec('200','a') =~ m/^(Um|Un|An|La|Le|Il) / ) { 
+if ( rec('200','a') =~ m/^(Um|Un|An|La|Le|Lo|Il) / ) { 
                marc_indicators('245', $i1, 3);
 } 
-
-if ( rec('200','a') =~ m/^(A|L) / ) { 
+if ( ( rec('101') =~ m/ENG/ ) && ( rec('200','a') =~ m/^A / ) ) { 
+               marc_indicators('245', $i1, 2);
+} 
+if ( rec('200','a') =~ m/^L / ) { 
                marc_indicators('245', $i1, 2);
 } 
-
 if ( rec('200','a') =~ m/^L'/ ) { 
                marc_indicators('245', $i1, 2);
 } 
 
 
 ### 245
-## potpolja i interpunkcije pripremljeni u modify
+## postoji modify
 ## da li treba makivati razmake u inicijalima?
 
 #_debug(3);
@@ -471,7 +496,7 @@ marc_compose('245',
                        rec('200','k'),
        ),
        'c', suffix(
-               ( rec('200','f') && rec('200','c') ) ? '.' :
+               ( rec('200','f') && rec('200','c') ) ? '. ' :
                        '',
                        join_with(' ; ',
                                regex('s/(\S\.)\s(\S\.\s)/$1$2/g',
@@ -484,7 +509,10 @@ marc_compose('245',
        ),
        ## append to last subfield
        '+', suffix('.',
-               rec('200','c'),
+               join_with(' / ',
+                       rec('200','c'),
+                       rec('200','x')
+               )
        ),
 );
 
@@ -531,7 +559,6 @@ marc('300','a',
                        rec('215','a')
        )
 );
-
 marc('300','b',
        suffix(
                ( rec('215','c') && rec('215','d') ) ? ' ; ' :
@@ -540,20 +567,19 @@ marc('300','b',
                        rec('215','c')
        )
 );
-
 marc('300','c',
        suffix(
                rec('215','e') ? ' + ' :
-                       '.',
+                       '',
                        rec('215','d')
        )
 );
-
 marc('300','e',
        rec('215','e')
 );
 
-### 362 - brojèani podaci za nakladnièku cjelinu - razjasniti upotrebu
+### 362 - brojèani podaci za nakladnièku cjelinu - to mi nemamo, polje se koristi samo za èasopise
+
 
 # if ( ! rec('225','z')  ) {
 
@@ -616,35 +642,33 @@ marc('300','e',
 
 #} else {
 
-
 ### 440 - indikatori
-## 2.ind. prema jeziku i èlanu, provjeriti
+## 2.ind. prema jeziku i èlanu, uskladiti s 245
 
 marc_indicators('440', ' ', '0');
 
-if ( rec('200','a') =~ m/^Einen / ) {
+if ( rec('225','a') =~ m/^Einen / ) {
                marc_indicators('440', ' ', 6);
 } 
 
-if ( rec('200','a') =~ m/^Eine / ) {
+if ( rec('225','a') =~ m/^Eine / ) {
                marc_indicators('440', ' ', 5);
 } 
 
-if ( rec('200','a') =~ m/^(Die|Das|Der|Ein|Les|The) / ) {
+if ( rec('225','a') =~ m/^(Die|Das|Der|Ein|Les|The) / ) {
                marc_indicators('440', ' ', 4);
 } 
 
-if ( rec('200','a') =~ m/^(Um|Un|An|La|Le|Il) / ) { 
+if ( rec('225','a') =~ m/^(Um|Un|An|La|Le|Il) / ) { 
                marc_indicators('440', ' ', 3);
 } 
 
-if ( rec('200','a') =~ m/^(A|L') / ) { 
+if ( rec('225','a') =~ m/^(A|L') / ) { 
                marc_indicators('440', ' ', 2);
 } 
 
 ## 440v nije ponovljivo
 
-
 marc_template(
        from => 225, to => 440,
        subfields_rename => [
@@ -676,7 +700,7 @@ marc_template(
                'a.|h,|i ;|w',
                'a.|i',
                'a.|i ;|w',
-               # gre¹ke
+               # gre¹ke:
                'a ;|v ;|w',
                'a.|h',
                'a.|h ;|w',
@@ -686,7 +710,6 @@ marc_template(
                'i ;|w',
                'v',    
                'w',
-
        ],
 );
 
@@ -826,7 +849,7 @@ marc('504','a',
 ## NSK konvertira 327 (NP) u 501 (R)
 ## u LOC konv. tablici stoji 327 (NP) u 505 (NR)
 ## standard i validacije dopu¹taju 501 (R) i 505 (R)
-
+## za svaku bazu posebno provjeriti sta je u poljima 327 i 330
 if ( config() =~ m/ffps|fftu/ ) {
        marc_indicators('505', '0', ' ');
        marc('505','a',
@@ -845,13 +868,8 @@ if ( config() =~ m/ffan/ ) {
 );
 }
 
-
-
-
 ### 520
 ## NSK konvertira 330 (P) u 520 (P) = LOC konv. tablica
-## FFPS 330 (NP) - sa¾etak
-
 if ( config() =~ m/ffps/ ) { 
        marc('520','a',
                regex('s/[\\r\\n]+/. /g',
@@ -894,54 +912,47 @@ marc('653','a',
 
 
 ### 700
-## ako je u originalu ponovljivo polje treba biti i konvertirano u ponovljivo !!
+## ako je u originalu ponovljivo polje treba bioti i konvertirano u ponovljivo !!
+## ako ima samo podpolje a onda je pseudonim - popraviti indikator
 
 marc_indicators('700', 1, ' ');
 
 marc('700','a',
        rec('701', 'a'),
 );
-
 marc('700','a',
        join_with(', ',
                rec('701', 'c'),
                rec('701', 'd')
        )
 );
-
 marc('700','a',
        join_with(', ',
                rec('701', 'e'),
                rec('701', 'f')
        )
 );
-
 marc('700','a',
        join_with(', ',
                rec('701', 'g'),
                rec('701', 'h')
        )
 );
-
-
 marc('700','a',
                rec('702', 'a'),
 );
-
 marc('700','a',
        join_with(', ',
                rec('702','c'),
                rec('702','d')
        )
 );
-
 marc('700','a',
        join_with(', ',
                rec('702','e'),
                rec('702','f')
        )
 );
-
 marc('700','a',
        join_with(', ',
                rec('702','g'),
@@ -952,7 +963,7 @@ marc('700','a',
 #_debug(0);
 
 
-### 740 - nadopuniti
+### 740 - sta s tim?
 
 marc_indicators('740', 0, ' ');
 
@@ -973,7 +984,7 @@ marc('740','a',
 
 # };
 
-
+# -------------------------------------------------------------------
 ### 760 w
 ## generiranje zapisa o nakladnièkoj cjelini i povezivanje podreðenog zapisa s nadreðenim
 
@@ -1042,98 +1053,90 @@ marc('740','a',
 #      rec('452','1')
 # );
 #
+# -------------------------------------------------------------------
 
-
-### 774 - Constituent Item Entry
+### 774 - Constituent Item Entry - to bi trebali koristiti ali ne koristimo jer NSK to koristi za ne¹to drugo
 ### 787 - Nonspecific Relationship Entry 
 
-marc_indicators('787','0',' ');
-
-marc_compose('787',
-       'g', rec('230','v'),
-       't', rec('230','a'),
-       'b', rec('240','a'),
-       'd', rec('250','a'),
-       'd', rec('250','d'),
-       'h', rec('260','a'),
-       'k', rec('270','a'),
-       'n', join_with('. - ',
-               rec('280'),
-       ),
-       'x', rec('290'),
-);
-
-marc_compose('787',
-       'g', rec('231','v'),
-       't', rec('231','a'),
-       'b', rec('241','a'),
-       'd', rec('251','a'),
-       'd', rec('251','d'),
-       'h', rec('261','a'),
-       'k', rec('271','a'),
-       'n', join_with('. - ',
-               rec('281'),
-       ),
-       'x', rec('291'),
-);
-
-marc_compose('787',
-       'g', rec('232','v'),
-       't', rec('232','a'),
-       'b', rec('242','a'),
-       'd', rec('252','a'),
-       'd', rec('252','d'),
-       'h', rec('262','a'),
-       'k', rec('272','a'),
-       'n', join_with('. - ',
-               rec('282'),
-       ),
-       'x', rec('292'),
-);
-
-marc_compose('787',
-       'g', rec('233','v'),
-       't', rec('233','a'),
-       'b', rec('243','a'),
-       'd', rec('253','a'),
-       'h', rec('263','a'),
-       'k', rec('273','a'),
-       'n', join_with('. - ',
-               rec('283'),
-       ),
-       'x', rec('293'),
-);
-
-
-
-### 852 - lokacija
-
-
-
-#marc('852','i',
-#      
+#marc_indicators('787','0',' ');
+#
+#marc_compose('787',
+#      'g', rec('230','v'),
+#      't', rec('230','a'),
+#      'b', rec('240','a'),
+#      'd', rec('250','a'),
+#      'd', rec('250','d'),
+#      'h', rec('260','a'),
+#      'k', rec('270','a'),
+#      'n', join_with('. - ',
+#              rec('280'),
+#      ),
+#      'x', join_with(', ',
+#              rec('290'),
+#      )
 #);
-
-       
+#marc_compose('787',
+#      'g', rec('231','v'),
+#      't', rec('231','a'),
+#      'b', rec('241','a'),
+#      'd', rec('251','a'),
+#      'd', rec('251','d'),
+#      'h', rec('261','a'),
+#      'k', rec('271','a'),
+#      'n', join_with('. - ',
+#              rec('281'),
+#      ),
+#      'x', join_with(', ',
+#              rec('291'),
+#      )
+#);
+#marc_compose('787',
+#      'g', rec('232','v'),
+#      't', rec('232','a'),
+#      'b', rec('242','a'),
+#      'd', rec('252','a'),
+#      'd', rec('252','d'),
+#      'h', rec('262','a'),
+#      'k', rec('272','a'),
+#      'n', join_with('. - ',
+#              rec('282'),
+#      ),
+#      'x', join_with(', ',
+#              rec('292'),
+#      )
+#);
+#marc_compose('787',
+#      'g', rec('233','v'),
+#      't', rec('233','a'),
+#      'b', rec('243','a'),
+#      'd', rec('253','a'),
+#      'h', rec('263','a'),
+#      'k', rec('273','a'),
+#      'n', join_with('. - ',
+#              rec('283'),
+#      ),
+#      'x', join_with(', ',
+#              rec('293'),
+#      )
+#);
+#
+### 852 - ne koristimo, koristimo  942 i 952
 
 ### 876 - item information - basic bibliographic unit
-
-marc('876','a',
-       rec('991','t'),
-);
+#marc('876','a',
+#      rec('991','t'),
+#);
 
 ### 886 - former marc
+# inicijale treba prebaciti u neko lokalno polje, a ovo polje nam ne treba
 
 marc_indicators('886', 2, ' ');
-
 marc('886','2',
        'ffmarc'
 );
-
 marc('886','a',
        '994'
 );
-
 marc('886','b',
        join_with(''.
                '##^a',
@@ -1148,15 +1151,22 @@ marc('886','b',
        )
 );
 
-### KOHA
+### KOHA items
 
 marc('942','b',
        'LIB'
 );
 
-marc('942','c',
-       'KNJ'
-);
+
+if ( grep( m/Posebni otisak/, rec('300') ) ) {
+       marc('942','c',
+               'SEP'
+       );
+} else {
+       marc('942','c',
+               'KNJ'
+       );
+}
 
 marc('942','d',
        join_with(' | ',
@@ -1164,18 +1174,18 @@ marc('942','d',
        )
 );     
 
-if ( config() =~ m/ffiz/ ) {
+if ( config() =~ m/ffan/ ) {
        my $novasig1 =
                lookup(
                        sub { rec('C') },
-                       'ffiz','mapirano',
+                       'ffan','mapirano',
                        sub { rec('B') },
                        sub { rec('990') }
                );
        my $novasig2 = 
                lookup(
                        sub { rec('C') . ' ' . rec('D') },
-                       'ffiz','starasig',
+                       'ffan','starasig',
                        sub { rec('A') },
                        sub { rec('000') },
                );
@@ -1188,204 +1198,199 @@ if ( config() =~ m/ffiz/ ) {
 }
 
 
-#if ( config() =~ m/ffsf|ffpo/ ) {
-#      my $sig1 = 
-#              lookup(
-#                      sub { rec('C') },
-#                      'ffiz','signature',
-#                      sub { rec('B') },
-#                      sub { frec('990') },
-#              );
-#      if ( rec('700','a') ) {
-#              marc('942','h',
-#                      $sig1,
-#              );
-#              if ( rec('200','a') =~ m/^(The|Die|Das|Der|Ein|Les) / ) {
-#                      marc('942','i',
-#                              join_with(' ',
-#                                      regex('s/(^.{3}).*/$1/',
-#                                              uc ( rec('700','a') )
-#                                      ),
-#                                      regex('s/^.{4}(.{1}).*/$1/',
-#                                              lc ( rec('200','a') )
-#                                      )
-#                              )
-#                      );
-#              } elsif ( rec('200','a') =~ m/^(Um|Un|An|La|Le|Il) / ) {
-#                      marc('942','i',
-#                              join_with(' ',
-#                                      regex('s/(^.{3}).*/$1/',
-#                                              uc ( rec('700','a') )
-#                                      ),
-#                                      regex('s/^.{3}(.{1}).*/$1/',
-#                                              lc ( rec('200','a') )
-#                                      )
-#                              )
-#                      );
-#              } elsif ( rec('200','a') =~ m/^Eine / ) {
-#                      marc('942','i',
-#                              join_with(' ',
-#                                      regex('s/(^.{3}).*/$1/',
-#                                              uc ( rec('700','a') )
-#                                      ),
-#                                      regex('s/^.{5}(.{1}).*/$1/',
-#                                              lc ( rec('200','a') )
-#                                      )
-#                              )
-#                      );
-#              } elsif ( rec('200','a') =~ m/^Einen / ) {
-#                      marc('942','i',
-#                              join_with(' ',
-#                                      regex('s/(^.{3}).*/$1/',
-#                                              uc ( rec('700','a') )
-#                                      ),
-#                                      regex('s/^.{6}(.{1}).*/$1/',
-#                                              lc ( rec('200','a') )
-#                                      )
-#                              )
-#                      );
-#              } elsif ( rec('200','a') =~ m/^(A|L) / ) {
-#                      marc('942','i',
-#                              join_with(' ',
-#                                      regex('s/(^.{3}).*/$1/',
-#                                              uc ( rec('700','a') )
-#                                      ),
-#                                      regex('s/^.{2}(.{1}).*/$1/',
-#                                              lc ( rec('200','a') )
-#                                      )
-#                              )
-#                      );
-#              } else {
-#                      marc('942','i',
-#                              join_with(' ',
-#                                      regex('s/(^.{3}).*/$1/',
-#                                              uc ( rec('700','a') )
-#                                      ),
-#                                      regex('s/(^.{1}).*/$1/',
-#                                              lc ( rec('200','a') )
-#                                      )
-#                              )
-#                      );
-#              }
-#      } elsif ( rec('710','a') ) {
-#              marc('942','h',
-#                      $sig1,
-#              );
-#              if ( rec('200','a') =~ m/^(The|Die|Das|Der|Ein|Les) / ) {
-#                      marc('942','i',
-#                              join_with(' ',
-#                                      regex('s/(^.{3}).*/$1/',
-#                                              uc ( rec('710','a') )
-#                                      ),
-#                                      regex('s/^.{4}(.{1}).*/$1/',
-#                                              lc ( rec('200','a') )
-#                                      )
-#                              )
-#                      );
-#              } elsif ( rec('200','a') =~ m/^(Um|Un|An|La|Le|Il) / ) {
-#                      marc('942','i',
-#                              join_with(' ',
-#                                      regex('s/(^.{3}).*/$1/',
-#                                              uc ( rec('710','a') )
-#                                      ),
-#                                      regex('s/^.{3}(.{1}).*/$1/',
-#                                              lc ( rec('200','a') )
-#                                      )
-#                              )
-#                      );
-#              } elsif ( rec('200','a') =~ m/^Eine / ) {
-#                      marc('942','i',
-#                              join_with(' ',
-#                                      regex('s/(^.{3}).*/$1/',
-#                                              uc ( rec('710','a') )
-#                                      ),
-#                                      regex('s/^.{5}(.{1}).*/$1/',
-#                                              lc ( rec('200','a') )
-#                                      )
-#                              )
-#                      );
-#              } elsif ( rec('200','a') =~ m/^Einen / ) {
-#                      marc('942','i',
-#                              join_with(' ',
-#                                      regex('s/(^.{3}).*/$1/',
-#                                              uc ( rec('710','a') )
-#                                      ),
-#                                      regex('s/^.{6}(.{1}).*/$1/',
-#                                              lc ( rec('200','a') )
-#                                      )
-#                              )
-#                      );
-#              } elsif ( rec('200','a') =~ m/^(A|L) / ) {
-#                      marc('942','i',
-#                              join_with(' ',
-#                                      regex('s/(^.{3}).*/$1/',
-#                                              uc ( rec('710','a') )
-#                                      ),
-#                                      regex('s/^.{2}(.{1}).*/$1/',
-#                                              lc ( rec('200','a') )
-#                                      )
-#                              )
-#                      );
-#              } else {
-#                      marc('942','i',
-#                              join_with(' ',
-#                                      regex('s/(^.{3}).*/$1/',
-#                                              uc ( rec('710','a') )
-#                                      ),
-#                                      regex('s/(^.{1}).*/$1/',
-#                                              lc ( rec('200','a') )
-#                                      )
-#                              )
-#                      );
-#              }
-#      } elsif ( rec('200','a') =~ m/^(The|Die|Das|Der|Ein|Les) / ) {
-#              marc('942','h',
-#                      $sig1,
-#              );
-#              marc('942','i',
-#                      regex('s/^.{4}(.{3}).*/$1/',
-#                              uc ( rec('200','a') )
-#                      ),
-#              );
-#                      
-#      } else {
-#              marc('942','h',
-#                      $sig1,
-#              );
-#              marc('942','i',
-#                      regex('s/(^\w{3}).*/$1/',
-#                              uc ( rec('200','a') )
-#                      )
-#              )
-#      }
-#} # if config()
-
-marc('952','8',
-       rec('991','8')
-);
-
-marc('952','a',
-       rec('991','a')
-);
-
-marc('952','b',
-       rec('991','b')
-);
-
-marc('952','c',
-       rec('991','c'),
-);
-
-marc('952','i',
-       rec('991','i')
-);
-
-marc('952','y',
-       rec('991','y')
-);
-
-
-
+if ( config() =~ m/ffsf|ffpo|fffi/ ) {
+       my $sig1 = 
+               lookup(
+                       sub { rec('C') },
+                       'fffi','signature',
+                       sub { rec('B') },
+                       sub { frec('990') },
+               );
+       if ( rec('700','a') ) {
+               marc('942','h',
+                       $sig1,
+               );
+               if ( rec('200','a') =~ m/^(The|Die|Das|Der|Ein|Les) / ) {
+                       marc('942','i',
+                               join_with(' ',
+                                       regex('s/(^.{3}).*/$1/',
+                                               uc ( rec('700','a') )
+                                       ),
+                                       regex('s/^.{4}(.{1}).*/$1/',
+                                               lc ( rec('200','a') )
+                                       )
+                               )
+                       );
+               } elsif ( rec('200','a') =~ m/^(Um|Un|An|La|Le|Il) / ) {
+                       marc('942','i',
+                               join_with(' ',
+                                       regex('s/(^.{3}).*/$1/',
+                                               uc ( rec('700','a') )
+                                       ),
+                                       regex('s/^.{3}(.{1}).*/$1/',
+                                               lc ( rec('200','a') )
+                                       )
+                               )
+                       );
+               } elsif ( rec('200','a') =~ m/^Eine / ) {
+                       marc('942','i',
+                               join_with(' ',
+                                       regex('s/(^.{3}).*/$1/',
+                                               uc ( rec('700','a') )
+                                       ),
+                                       regex('s/^.{5}(.{1}).*/$1/',
+                                               lc ( rec('200','a') )
+                                       )
+                               )
+                       );
+               } elsif ( rec('200','a') =~ m/^Einen / ) {
+                       marc('942','i',
+                               join_with(' ',
+                                       regex('s/(^.{3}).*/$1/',
+                                               uc ( rec('700','a') )
+                                       ),
+                                       regex('s/^.{6}(.{1}).*/$1/',
+                                               lc ( rec('200','a') )
+                                       )
+                               )
+                       );
+               } elsif ( rec('200','a') =~ m/^(A|L) / ) {
+                       marc('942','i',
+                               join_with(' ',
+                                       regex('s/(^.{3}).*/$1/',
+                                               uc ( rec('700','a') )
+                                       ),
+                                       regex('s/^.{2}(.{1}).*/$1/',
+                                               lc ( rec('200','a') )
+                                       )
+                               )
+                       );
+               } else {
+                       marc('942','i',
+                               join_with(' ',
+                                       regex('s/(^.{3}).*/$1/',
+                                               uc ( rec('700','a') )
+                                       ),
+                                       regex('s/(^.{1}).*/$1/',
+                                               lc ( rec('200','a') )
+                                       )
+                               )
+                       );
+               }
+       } elsif ( rec('710','a') ) {
+               marc('942','h',
+                       $sig1,
+               );
+               if ( rec('200','a') =~ m/^(The|Die|Das|Der|Ein|Les) / ) {
+                       marc('942','i',
+                               join_with(' ',
+                                       regex('s/(^.{3}).*/$1/',
+                                               uc ( rec('710','a') )
+                                       ),
+                                       regex('s/^.{4}(.{1}).*/$1/',
+                                               lc ( rec('200','a') )
+                                       )
+                               )
+                       );
+               } elsif ( rec('200','a') =~ m/^(Um|Un|An|La|Le|Il) / ) {
+                       marc('942','i',
+                               join_with(' ',
+                                       regex('s/(^.{3}).*/$1/',
+                                               uc ( rec('710','a') )
+                                       ),
+                                       regex('s/^.{3}(.{1}).*/$1/',
+                                               lc ( rec('200','a') )
+                                       )
+                               )
+                       );
+               } elsif ( rec('200','a') =~ m/^Eine / ) {
+                       marc('942','i',
+                               join_with(' ',
+                                       regex('s/(^.{3}).*/$1/',
+                                               uc ( rec('710','a') )
+                                       ),
+                                       regex('s/^.{5}(.{1}).*/$1/',
+                                               lc ( rec('200','a') )
+                                       )
+                               )
+                       );
+               } elsif ( rec('200','a') =~ m/^Einen / ) {
+                       marc('942','i',
+                               join_with(' ',
+                                       regex('s/(^.{3}).*/$1/',
+                                               uc ( rec('710','a') )
+                                       ),
+                                       regex('s/^.{6}(.{1}).*/$1/',
+                                               lc ( rec('200','a') )
+                                       )
+                               )
+                       );
+               } elsif ( rec('200','a') =~ m/^(A|L) / ) {
+                       marc('942','i',
+                               join_with(' ',
+                                       regex('s/(^.{3}).*/$1/',
+                                               uc ( rec('710','a') )
+                                       ),
+                                       regex('s/^.{2}(.{1}).*/$1/',
+                                               lc ( rec('200','a') )
+                                       )
+                               )
+                       );
+               } else {
+                       marc('942','i',
+                               join_with(' ',
+                                       regex('s/(^.{3}).*/$1/',
+                                               uc ( rec('710','a') )
+                                       ),
+                                       regex('s/(^.{1}).*/$1/',
+                                               lc ( rec('200','a') )
+                                       )
+                               )
+                       );
+               }
+       } elsif ( rec('200','a') =~ m/^(The|Die|Das|Der|Ein|Les) / ) {
+               marc('942','h',
+                       $sig1,
+               );
+               marc('942','i',
+                       regex('s/^.{4}(.{3}).*/$1/',
+                               uc ( rec('200','a') )
+                       ),
+               );
+                       
+       } else {
+               marc('942','h',
+                       $sig1,
+               );
+               marc('942','i',
+                       regex('s/(^\w{3}).*/$1/',
+                               uc ( rec('200','a') )
+                       )
+               )
+       }
+} # if config()
 
+if ( ( rec('230') || rec('231') || rec('232') || rec('233') ) ) { 
+       warn "nema primjeraka";
+} else {
+       marc('952','8',
+               rec('991','8')
+       );
+       marc('952','a',
+               rec('991','a')
+       );
+       marc('952','b',
+               rec('991','b')
+       );
+       marc('952','c',
+               rec('991','c'),
+       );
+       marc('952','i',
+               rec('991','i')
+       );
+       marc('952','y',
+               rec('991','y')
+       );
+}
 } # polje 200a
 # } sig