/[webpac2]/trunk/conf/normalize/ff-peri.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/conf/normalize/ff-peri.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 903 by dpavlin, Wed Oct 10 21:00:48 2007 UTC revision 905 by dpavlin, Mon Oct 29 21:59:43 2007 UTC
# Line 1  Line 1 
1  if ( rec('200','a') ) {  if ( rec('200','a') ) {
2    
3    ### LEADER
 # LEADER  
4  # raspraviti 17,18  # raspraviti 17,18
5    
6  marc_leader('05','n');  marc_leader('05','n');          # Record status
7  marc_leader('06','a');  marc_leader('06','a');          # Type of record
8    
9  if ( rec('225','a') ) {  if ( rec('225','a') ) {
10          marc_leader('07','b');          marc_leader('07','d');  
11  } else {  } else {
12          marc_leader('07','s');          marc_leader('07','s');  # Bibliographic level
13  }  }
14    
15  marc_leader('18','i');  marc_leader('18','i');          # Descriptive cataloging form
16    
17  if ( rec('225','a') ) {  if ( rec('225','a') ) {
18          marc_leader('19','r');          marc_leader('19','r');  # Linked record requirement
19  }  }
20    
21  # 001 polje - Voyager  ### 001 - Voyager
22    
23  # 007  ### 007
24  marc_fixed('007',00,'ta');  marc_fixed('007',00,'ta');
25    
26    
27  ## 008 - All materials  ### 008 - All materials
28  marc_fixed('008','00', '070707');       # Date entered on file  # što zapisati u polje kad datum nije poznat?
 marc_fixed('008','06', 't');            # Type of date/Publication status  
 if ( rec('11') ) {  
         if ( my $lookup = lookup(  
                         sub { rec('210','d') },  
                         'nsk','bbaza',  
                         sub { first( rec('011','a') ) },  
                         sub { rec('11') },  
                 )  
         ) {  
                 marc_fixed('008','07', $lookup);  
         } else {  
                 marc_fixed('008','07',  
                         rec('210','d')  
                 );  
         }  
 }                                       # Date 1  
29    
30  # marc_fixed('008','11', ' ');          # Date 2  marc_fixed('008','00', '070707');       # 00-05 - Date entered on file
 marc_fixed('008','15',  
         lc ( rec('102') )  
 );                              # Place of publication, production, or execution  
 #marc_fixed('008','35',  
 #       rec('101')  
 #);                             # Language  
 marc_fixed('008','38', '|');    # Modified record  
 marc_fixed('008','39','d');     # Cataloging source  
31    
32    ## za 008 06 treba i lookup u tablicu gdje postoji podatak o tome jel tekuci casopis ili nije?
33    ## c - Continuing resource currently published
34    ## d - Continuing resource ceased publication
35    
36    if ( rec('210','c') ) {
37            marc_fixed('008','06','s');             # 06 - Type of date/Publication status, s = single know date
38    
39            my $year = rec('210','c');
40            warn "## year = $year";
41            if ( $year =~ m/^(\d{4})/ ) {
42    #       warn "## $1 ##";
43                    marc_fixed('008','07',$1);              # 07-10 - Date 1
44            }
45                    
46    } else {
47            marc_fixed('008','06','n');             # 06 - n = unknown date
48    }
49    
 ## 008 - Continuing resources  
 marc_fixed('008','18', '|');    # Frequency - ovo treba popuniti iz polja 326  
 marc_fixed('008','19', '|');    # Regularity  
 marc_fixed('008','21', 'p');    # Type of continuing resource  
 marc_fixed('008','29', '|');    # Conference publication  
 marc_fixed('008','33', '|');    # Original alphabet or script of title  
 marc_fixed('008','34', '|');    # Entry convention  
50    
51    
52    # marc_fixed('008','11', ' ');          # 11-14 - Date 2
53    marc_fixed('008','15',
54            lc ( rec('102') )
55    );                                      # 15-17 - Place of publication, production, or execution
56    marc_fixed('008','35',
57            first( lc(rec('101')) )         # 35-37 - Language
58    );
59    marc_fixed('008','38', '|');            # 38 - Modified record
60    marc_fixed('008','39','d');             # 39 - Cataloging source
61    
62    
63    ### 008 - Continuing resources
64    
65    if ( ! rec('225','a') ) {
66    
67    marc_fixed('008','18', '|');    # 18 - Frequency - ovo treba popuniti iz polja 326
68                                    # 19 - Regularity
69                                    # 20 - Undefined, ontains a blank (#) or fill character (|)
70    
71    # za polje 008 21 treba lookup u tablicu:
72    marc_fixed('008','21', 'p');    # 21 - Type of continuing resource
73    
74                                    # 22 - Form of original item - blank
75                                    # 23 - Form of item
76                                    # 24 - Nature of entire work
77                                    # 25-27 - Nature of contents
78                                    # 28 - Government publication
79                                    # 29 - Conference publication
80                                    # 30-32 - Undefined
81                                    # 33 - Original alphabet or script of title
82                                    # 34 - Entry convention
83    }
84    
85  ## 022  ## 022
86  # if ( ! rec('225','a') ) {  # if ( ! rec('225','a') ) {
87  #       marc('022','a',  #       marc('022','a',
# Line 72  marc_fixed('008','34', '|');   # Entry con Line 90  marc_fixed('008','34', '|');   # Entry con
90  # }  # }
91  #  #
92    
93  ## 022  ### 022
 marc('022','a',  
         rec('11')  
 );  
94    
95    if ( ! rec('225','a') ) {
96            marc('022','a',
97                    rec('11')
98            );
99    }
100    
101    ### 035$6
102  # privemeno koristimo 0356 umjesto 0359, zato što marclint 9 prijavljuje kao grešku  # privemeno koristimo 0356 umjesto 0359, zato što marclint 9 prijavljuje kao grešku
103    
104  marc('035','6',  marc('035','6',
# Line 89  marc('035','6', Line 110  marc('035','6',
110  );  );
111    
112    
113    ### 040
114    # za sve je isti
115    # treba utvrditi točnu oznaku za ustanovu
116    
117  marc('040','a',  marc('040','a',
118          'HR FFZG'          'HR FFZG'
119  );  );
# Line 101  marc('040','e', Line 126  marc('040','e',
126          'HR PPIAK'          'HR PPIAK'
127  );  );
128    
129    ### 041 - indikatori
130    
131  marc_indicators('041', 0, ' ');  marc_indicators('041', 0, ' ');
132    
133    ### 041
134    
135  marc_repeatable_subfield('041','a',  marc_repeatable_subfield('041','a',
136          rec('101')          rec('101')
137  );  );
# Line 110  marc_repeatable_subfield('041','a', Line 139  marc_repeatable_subfield('041','a',
139    
140  #_debug(3);  #_debug(3);
141    
142  ## 044 - zemlja izdavanja  ### 044 - zemlja izdavanja
143    
144  if ( rec('11') ) {  marc('044','a',
145          if ( my $lookup = lookup(          rec('102')
146                          sub { rec('102','a') },  );
147                          'nsk','bbaza',  
148                          sub { first( rec('011','a') ) },  ### 080
                         sub { rec('11') },  
                 )  
         ) {  
                 marc('044','a', $lookup );  
         } else {  
                 marc('044','a',  
                         rec('102')  
                 );  
         }  
 }  
149    
150  marc('080','a',  marc('080','a',
151          rec('675','a')          rec('675','a')
152  );  );
153    
154  marc_indicators('210', '1',' ');  ### 210 indikatori
155    
156  if ( rec('11') ) {  # marc_indicators('210', '1',' ');
157  marc('210','a',  
158          lookup(  ### 210
159                  sub { rec('531','a') },  # pronaći priladan izvor podataka (nsk baza, issn baza)
160                  'nsk','bbaza',  
161                  sub { rec('011','a') },  
162                  sub { rec('11') },  ## iz nsk
163          )  #if ( rec('11') ) {
164  );  #marc('210','a',
165  }  #       lookup(
166    #               sub { rec('531','a') },
167    #               'nsk','bbaza',
168    #               sub { rec('011','a') },
169    #               sub { rec('11') },
170    #       )
171    #);
172    #}
173    
174    ### 222 indikatori
175    # drugi indikator prema članu
176    
177    marc_indicators('222',' ','0');
178    
179    ### 222 - Key title
180    # pronaći prikadan izvor podataka - nsk baza, issn baze
181    
 marc_indicators('222',' ','0');         # drugi indikator prema članu  
 if ( rec('11') ) {  
182  marc('222','a',  marc('222','a',
183          lookup(          rec('530')
                 sub { rec('530','a') },  
                 'nsk','bbaza',  
                 sub { rec('011','a') },  
                 sub { rec('11') },  
         )  
184  );  );
185  }  
186    # iz nsk:
187    #if ( rec('11') ) {
188    #marc('222','a',
189    #       lookup(
190    #               sub { rec('530','a') },
191    #               'nsk','bbaza',
192    #               sub { rec('011','a') },
193    #               sub { rec('11') },
194    #       )
195    #);
196    #}
197    
198  ### 245 indikatori  ### 245 indikatori
199    # generiraju se prema članu i jeziku. potrebna naknadna kontrola.
200    
201  if (    ( rec('200','a') =~ m/^Die /) ||  if (    ( rec('200','a') =~ m/^Die /) ||
202          ( rec('200','a') =~ m/^Das /) ||          ( rec('200','a') =~ m/^Das /) ||
# Line 168  if (   ( rec('200','a') =~ m/^Die /) || Line 207  if (   ( rec('200','a') =~ m/^Die /) ||
207  }  }
208    
209    
210  ## 245  ### 245
211    
212  marc_compose('245',  marc_compose('245',
213          'a', suffix(          'a', suffix(
214                  ( ! ( rec('200','d') || rec('200','e') || rec('200','k') ) ) && ( rec('200','f') ) ? ' / ' :                    ( ! ( rec('200','d') || rec('200','e') || rec('200','k') ) ) && ( rec('200','f') ) ? ' / ' :  
# Line 204  marc_compose('245', Line 244  marc_compose('245',
244          '+', rec('200','c'),          '+', rec('200','c'),
245  );  );
246    
247  ## 246  ### 246 inikatori
248    # prema jeziku - provjera
249    
250  if (    ( rec('200','a') =~ m/^Die /) ||  if (    ( rec('200','a') =~ m/^Die /) ||
251          ( rec('200','a') =~ m/^Das /) ||          ( rec('200','a') =~ m/^Das /) ||
252          ( rec('200','a') =~ m/^The /) ) {          ( rec('200','a') =~ m/^The /) ) {
# Line 213  if (   ( rec('200','a') =~ m/^Die /) || Line 255  if (   ( rec('200','a') =~ m/^Die /) ||
255          marc_indicators('246', 0, 0);          marc_indicators('246', 0, 0);
256  }  }
257    
258    ### 246
259    # povući podatke iz prikladnog izvora (nsk, issn)
260    
261  if ( rec('532') ) {  marc('246','a',
262          marc('246','a',          rec('532')
263                  rec('532')  );
         );  
 }  
264    
265  #else {  ## iz nsk:
266  #       marc('246','a',  #       marc('246','a',
267  #               lookup(  #               lookup(
268  #                       sub { rec('532','a') },  #                       sub { rec('532','a') },
# Line 229  if ( rec('532') ) { Line 271  if ( rec('532') ) {
271  #                       sub { rec('11') },  #                       sub { rec('11') },
272  #               )  #               )
273  #       );  #       );
 #}  
274    
275  #_debug(0);  #_debug(0);
276    
277    
278  ## 260 - izdavanje  ## 260 - izdavanje
279    # provjeriti interpunkcije !!, u NSK nesto ne stima
280    
281    marc_original_order('260','210');
282    
283    ## lookup u NSK:
284  # if ( rec('11') ) {  # if ( rec('11') ) {
285  #       marc_repeatable_subfield('260','a',  #       marc_repeatable_subfield('260','a',
286  #               lookup(  #               lookup(
# Line 265  if ( rec('532') ) { Line 310  if ( rec('532') ) {
310  #       marc_original_order('260', '210');  #       marc_original_order('260', '210');
311  # }  # }
312    
 marc_original_order('260','210');  
313    
314  # provjeriti interpunkcije !!  ### 300
 # u NSK nesto ne stima  
315    
316  marc('300','a',  marc('300','a',
317          suffix(          suffix(
# Line 301  marc('300','e', Line 344  marc('300','e',
344          rec('215','e')          rec('215','e')
345  );  );
346    
347  ## 310 - current stated publication frequency  ### 310 - current stated publication frequency
348    # potrebno ujednačiti, polje 008?
349    
350  marc('310','a',  marc('310','a',
351          rec('326')          rec('326')
352  );  );
353    
354  ## 321 - former frequency of either an item or an update to an item when a current frequency is contained in field 310  ### 321 - former frequency of either an item or an update to an item when a current frequency is contained in field 310
355    
356  # marc('321','a',  # marc('321','a',
357  #       ovo bi trebalo procitati iz NSK konvertiranih podataka  #       ovo bi trebalo procitati iz NSK konvertiranih podataka
358  #);  #);
359    
360  marc_indicators('362', 0, ' ');  marc_indicators('362', 0, ' ');
361    
362    ### 362
363  ## 362  #
364  if ( rec('207','a') ) {  if ( rec('207','a') ) {
365          marc('362','a',          marc('362','a',
366                  rec('207','a'),                  rec('207','a'),
367          );          );
368  } else {  }
369          if ( rec('11') ) {  
370                  marc('362','a',  ## lookup iz nsk
371                          lookup(  #else {
372                                  sub { rec('207','a') },  #       if ( rec('11') ) {
373                                  'nsk','bbaza',  #               marc('362','a',
374                                  sub { first( rec('011','a') ) },  #                       lookup(
375                                  sub { rec('11') },  #                               sub { rec('207','a') },
376                          )  #                               'nsk','bbaza',
377                  );  #                               sub { first( rec('011','a') ) },
378          }  #                               sub { rec('11') },
379  }  #                       )
380    #               );
381    #       }
382    #}
383    
384    ### 490 ind.
385    
386    marc_indicators('490', '0', ' ');
387    
388    ### 490
389    
390    marc('490','a',
391            join_with('. ',
392                    join_with(' / ',
393                            join_with(' : ',
394                                    join_with(' = ',
395                                            rec('225','a'),
396                                            rec('225','d')
397                                    ),
398                                    rec('225','e')
399                            ),
400                            join_with(' ; ',
401                                    rec('225','f'),
402                                    rec('225','g')
403                            ),
404                    ),
405                    rec('225','h')
406            )
407    );
408    
409    marc('490','v',
410            rec('225','v')
411    );
412    
413    marc('490','x',
414            rec('225','x')
415    );
416    
417    #if ( rec('225','a') && rec('11') ) {
418    #       marc('999','a',
419    #               lookup(
420    #                       sub { rec('110','a'), },
421    #                       'nsk','bbaza',
422    #                       sub { rec('011','a') },
423    #                       sub { rec('11') }
424    #               )
425    #       );
426    #}
427    
428    
429    
430    ### 5xx
431    # koje podatke povući iz drugih baza?
432    
 ## 5xx  
433  marc('500','a',  marc('500','a',
434          rec('300','a'),          rec('300','a'),
435  );  );
436    
437    
438    ### 534 - napomena o pretisku
439    
440  marc('534','a',  marc('534','a',
441          rec('324')          rec('324')
442  );  );
443    
444  if ( rec('11') ) {  ## potencijalno za izvući iz NSK
445  marc('546','a',  #if ( rec('11') ) {
446          lookup(  #marc('546','a',
                 sub { rec('302','a') },  
                 'nsk','bbaza',  
                 sub { rec('011','a') },  
                 sub { rec('11') },  
         )  
 );  
   
 marc('550','a',  
         lookup(  
                 sub { rec('314','a') },  
                 'nsk','bbaza',  
                 sub { rec('011','a') },  
                 sub { rec('11') },  
         )  
 );  
   
 marc('555','a',  
         lookup(  
                 sub { rec('320','a') },  
                 'nsk','bbaza',  
                 sub { rec('011','a') },  
                 sub { rec('11') },  
         )  
 );  
   
   
 # marc('562','a',  
447  #       lookup(  #       lookup(
448  #               sub { rec('316','a') },  #               sub { rec('302','a') },
449  #               'nsk','bbaza',  #               'nsk','bbaza',
450  #               sub { rec('011','a') },  #               sub { rec('011','a') },
451  #               sub { rec('11') },  #               sub { rec('11') },
452  #       )  #       )
453  # );  #);
454  }  #
455    #marc('550','a',
456    #       lookup(
457    #               sub { rec('314','a') },
458    #               'nsk','bbaza',
459    #               sub { rec('011','a') },
460    #               sub { rec('11') },
461    #       )
462    #);
463    #
464    #marc('555','a',
465    #       lookup(
466    #               sub { rec('320','a') },
467    #               'nsk','bbaza',
468    #               sub { rec('011','a') },
469    #               sub { rec('11') },
470    #       )
471    #);
472    #
473    #
474    ## marc('562','a',
475    ##      lookup(
476    ##              sub { rec('316','a') },
477    ##              'nsk','bbaza',
478    ##              sub { rec('011','a') },
479    ##              sub { rec('11') },
480    ##      )
481    ## );
482    #}
483    
484    ### 653 indikatori
485  marc_indicators('653', 0, ' ');  marc_indicators('653', 0, ' ');
486    
487    ### 653
488    
489  marc('653','a',  marc('653','a',
490          rec('610')          rec('610')
491  );  );
# Line 399  marc('653','a', Line 503  marc('653','a',
503    
504  #_debug(2);  #_debug(2);
505    
506    ### 700 indikatori
507    
508  marc_indicators('700', 1, ' ');  marc_indicators('700', 1, ' ');
509    
510    ### 700
511    
512  marc('700','a',  marc('700','a',
513          rec('702','a'),          rec('702','a'),
514  );  );
# Line 415  marc('700','a', Line 523  marc('700','a',
523    
524  #_debug(0);  #_debug(0);
525    
526    ### 710 indikatori
527    
528  marc_indicators('710', '2', ' ');  marc_indicators('710', '2', ' ');
529    
530    ### 710
531  marc('710','a',  marc('710','a',
532          rec('710','a')          rec('710','a')
533  );  );
534    
535    ### 770 indikatori
536    
537  marc_indicators('770', 0, ' ');  marc_indicators('770', 0, ' ');
538    
539    ### 770
540  marc('770','t',  marc('770','t',
541          rec('421','a'),          rec('421','a'),
542  );  );
543    
544    ### 772 indikatori
545  marc_indicators('772', 0, ' ');  marc_indicators('772', 0, ' ');
546    
547    ### 772
548  marc('772','t',  marc('772','t',
549          rec('422','a'),          rec('422','a'),
550  );  );
551    
552    ### 777 indikatori
553    
554  marc_indicators('777', 0, ' ');  marc_indicators('777', 0, ' ');
555    
556    ### 777
557  marc('777','t',  marc('777','t',
558          rec('423','a'),          rec('423','a'),
559  );  );
560    
561    ### 780 indikatori
562    
563  marc_indicators('780', 0, 0);  marc_indicators('780', 0, 0);
564    
565    ### 780
566  marc('780','t',  marc('780','t',
567          rec('430','a'),          rec('430','a'),
568  );  );
569    
570    ### 785 indikatori
571    
572  marc_indicators('785', 0, 0);  marc_indicators('785', 0, 0);
573    
574    ### 785
575  marc('785','t',  marc('785','t',
576          rec('440','a'),          rec('440','a'),
577  );  );
578    
579    ### 852
580    
581  marc('852','j',  marc('852','j',
582          join_with(' ',          join_with(' ',
583                  rec('990')                  rec('990')
584          )          )
585  );  );
586    
587    ### 876
588    
589  marc('876','a',  marc('876','a',
590          rec('991','a')          rec('991','a')
591  );  );
592    
593    ### 992
594    
595  marc('992','a',  marc('992','a',
596          join_with(' ; ',          join_with(' ; ',
597                  rec('992')                  rec('992')
598          )          )
599  );  );
600    
601    
602    ### polja za probu
603    
604    
605    #marc('998','a',
606    #       lookup(
607    #               sub { rec('200','a') },
608    #               'ffiz','peri',
609    #               sub { rec('200','a'), },
610    #               sub { rec('225','a'), }
611    #       )
612    #);
613    
614    
615  # marc('997','a',  # marc('997','a',
616  #       sort(  #       sort(
# Line 496  marc('992','a', Line 645  marc('992','a',
645  #       )  #       )
646  # );  # );
647    
648  }  } # 200a

Legend:
Removed from v.903  
changed lines
  Added in v.905

  ViewVC Help
Powered by ViewVC 1.1.26