/[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 905 by dpavlin, Mon Oct 29 21:59:43 2007 UTC revision 944 by dpavlin, Wed Oct 31 18:07:33 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');          # Record status  marc_leader('05','n');          # Record status
7  marc_leader('06','a');          # Type of record  marc_leader('06','a');          # Type of record
8    
9    ## izvuci podatke iz tablice (za po i sf)
10    
11  if ( rec('225','a') ) {  if ( rec('225','a') ) {
12          marc_leader('07','d');            marc_leader('07','d');  
13  } else {  } else {
# Line 14  if ( rec('225','a') ) { Line 16  if ( rec('225','a') ) {
16    
17  marc_leader('18','i');          # Descriptive cataloging form  marc_leader('18','i');          # Descriptive cataloging form
18    
19    # ako postoji neko od polja 76x-78x - LDR 19 je r, ako ne postoji onda je prazno
20    # tematski brojevi imaju vezu u
21    
22  if ( rec('225','a') ) {  if ( rec('225','a') ) {
23          marc_leader('19','r');  # Linked record requirement          marc_leader('19','r');  # Linked record requirement
24  }  }
# Line 23  if ( rec('225','a') ) { Line 28  if ( rec('225','a') ) {
28  ### 007  ### 007
29  marc_fixed('007',00,'ta');  marc_fixed('007',00,'ta');
30    
   
31  ### 008 - All materials  ### 008 - All materials
32  # što zapisati u polje kad datum nije poznat?  # što zapisati u polje kad datum nije poznat?
33    
# Line 33  marc_fixed('008','00', '070707');      # 00-0 Line 37  marc_fixed('008','00', '070707');      # 00-0
37  ## c - Continuing resource currently published  ## c - Continuing resource currently published
38  ## d - Continuing resource ceased publication  ## d - Continuing resource ceased publication
39    
40    my $year = rec('210','c');
41    
42  if ( rec('210','c') ) {  if ( rec('210','c') ) {
43          marc_fixed('008','06','s');             # 06 - Type of date/Publication status, s = single know date          marc_fixed('008','06','s');             # 06 - Type of date/Publication status, s = single know date
44            
45    #       warn "## year = $year";
46    
         my $year = rec('210','c');  
         warn "## year = $year";  
47          if ( $year =~ m/^(\d{4})/ ) {          if ( $year =~ m/^(\d{4})/ ) {
48  #       warn "## $1 ##";  #       warn "## $1 ##\n";
49                  marc_fixed('008','07',$1);              # 07-10 - Date 1                  marc_fixed('008','07',$1);              # 07-10 - Date 1
50          }          }
51                    
52            if ( $year =~ m/^\d{4}-(\d{4})/ ) {
53    #       warn "## $1 ##";
54                    marc_fixed('008','11',$1);              # 11-14 - Date 2
55                    marc_fixed('008','06','d');
56            }
57            
58  } else {  } else {
59          marc_fixed('008','06','n');             # 06 - n = unknown date          marc_fixed('008','06','n');             # 06 - n = unknown date
60  }  }
61    
62    
63    marc_fixed('008','15',                  # 15-17 - Place of publication, production, or execution
 # marc_fixed('008','11', ' ');          # 11-14 - Date 2  
 marc_fixed('008','15',  
64          lc ( rec('102') )          lc ( rec('102') )
65  );                                      # 15-17 - Place of publication, production, or execution  );
66    
67    
68    
69  marc_fixed('008','35',  marc_fixed('008','35',
70          first( lc(rec('101')) )         # 35-37 - Language          first( lc(rec('101')) )         # 35-37 - Language
71  );  );
72  marc_fixed('008','38', '|');            # 38 - Modified record                                          # 38 - Modified record
73  marc_fixed('008','39','d');             # 39 - Cataloging source                                          # 39 - Cataloging source
   
74    
75  ### 008 - Continuing resources  ### 008 - Continuing resources
76    
77  if ( ! rec('225','a') ) {  if ( ! rec('225','a') ) {
78    
79  marc_fixed('008','18', '|');    # 18 - Frequency - ovo treba popuniti iz polja 326  marc_fixed('008','18', 'u');    # 18 - Frequency - ovo treba popuniti iz polja 326
80                                  # 19 - Regularity  marc_fixed('008','19', 'u');    # 19 - Regularity
81                                  # 20 - Undefined, ontains a blank (#) or fill character (|)                                  # 20 - Undefined, ontains a blank (#) or fill character (|)
82    
83  # za polje 008 21 treba lookup u tablicu:  # za polje 008 21 treba lookup u tablicu:
# Line 92  marc_fixed('008','21', 'p');   # 21 - Type Line 104  marc_fixed('008','21', 'p');   # 21 - Type
104    
105  ### 022  ### 022
106    
107  if ( ! rec('225','a') ) {  #if ( ! rec('225','a') ) {
108          marc('022','a',          marc('022','a',
109                  rec('11')                  rec('11')
110          );          );
111  }  #}
112    
113  ### 035$6  ### 035$6
114  # 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
115    
116  marc('035','6',  my $id;
117    
118    $id = (
119          join_with('',          join_with('',
120                  uc( config() ),                  uc( config() ),
121                  ' P',                  ' P',
# Line 109  marc('035','6', Line 123  marc('035','6',
123          )          )
124  );  );
125    
126    marc('035','6', $id);
127    
128  ### 040  ### 040
129  # za sve je isti  # za sve je isti
# Line 152  marc('080','a', Line 167  marc('080','a',
167  );  );
168    
169  ### 210 indikatori  ### 210 indikatori
   
170  # marc_indicators('210', '1',' ');  # marc_indicators('210', '1',' ');
171    
172  ### 210  ### 210 - ABBREVIATED TITLE
173  # pronaći priladan izvor podataka (nsk baza, issn baza)  # pronaći prikladan izvor podataka (nsk baza, issn baza)
   
174    
175  ## iz nsk  ## iz nsk
176  #if ( rec('11') ) {  #if ( rec('11') ) {
# Line 198  marc('222','a', Line 211  marc('222','a',
211  ### 245 indikatori  ### 245 indikatori
212  # generiraju se prema članu i jeziku. potrebna naknadna kontrola.  # generiraju se prema članu i jeziku. potrebna naknadna kontrola.
213    
214    marc_indicators('245', 0, 0);
215    
216  if (    ( rec('200','a') =~ m/^Die /) ||  if (    ( rec('200','a') =~ m/^Die /) ||
217          ( rec('200','a') =~ m/^Das /) ||          ( rec('200','a') =~ m/^Das /) ||
218            ( rec('200','a') =~ m/^Der /) ||
219            ( rec('200','a') =~ m/^Les /) ||
220          ( rec('200','a') =~ m/^The /) ) {          ( rec('200','a') =~ m/^The /) ) {
221                  marc_indicators('245', 0, 4);                  marc_indicators('245', 0, 4);
222  } else {  
223          marc_indicators('245', 0, 0);  }
224  }  
225    if (    ( rec('200','a') =~ m/^Un /) ||
226            ( rec('200','a') =~ m/^An /) ||
227            ( rec('200','a') =~ m/^La /) ||
228            ( rec('200','a') =~ m/^Le /) ||
229            ( rec('200','a') =~ m/^Il /) ) {
230                    marc_indicators('245', 0, 3);
231    }
232    
233    
234    if (    ( rec('200','a') =~ m/^A /) ||
235            ( rec('200','a') =~ m/^L'/) ) {
236                    marc_indicators('245', 0, 2);
237    }
238    
239    
240    
241  ### 245  ### 245
242    
243  marc_compose('245',  marc_compose('245',
244          'a', suffix(          'a', suffix(
245                  ( ! ( rec('200','d') || rec('200','e') || rec('200','k') ) ) && ( rec('200','f') ) ? ' / ' :                    ( ! ( rec('200','d') || rec('200','e') || rec('200','k') ) ) && ( rec('200','f') ) ? ' /' :  
246                  ( rec('200','d') ) ? ' = ' :                  ( rec('200','d') ) ? ' =' :
247                  ( rec('200','e') ) ? ' : ' :                  ( rec('200','e') ) ? ' :' :
248                  ( rec('200','k') ) ? ' ; ' :                  ( rec('200','k') ) ? ' ;' :
249                          '',                          '',
250                          rec('200','a'),                          rec('200','a'),
251          ),          ),
252          'b', suffix(          'b', suffix(
253                  ( rec('200','d') && rec('200','f') ) ? ' / ' :                  ( rec('200','d') && rec('200','f') ) ? ' /' :
254                  ( rec('200','d') && rec('200','c') ) ? '. '  :                  ( rec('200','d') && rec('200','c') ) ? '.'  :
255                          '',                          '',
256                          rec('200','d'),                          rec('200','d'),
257          ),          ),
258          'b', suffix(          'b', suffix(
259                  ( rec('200','e') && rec('200','f') ) ? ' / ' :                  ( rec('200','e') && rec('200','f') ) ? ' /' :
260                  ( rec('200','e') && rec('200','c') ) ? '. '  :                  ( rec('200','e') && rec('200','c') ) ? '.'  :
261                          '',                          '',
262                          rec('200','e'),                          rec('200','e'),
263          ),          ),
264          'b', suffix(          'b', suffix(
265                  ( rec('200','k') && rec('200','f') ) ? ' / ' :                  ( rec('200','k') && rec('200','f') ) ? ' /' :
266                  ( rec('200','k') && rec('200','c') ) ? '. '  :                  ( rec('200','k') && rec('200','c') ) ? '.'  :
267                          '',                          '',
268                          rec('200','k'),                          rec('200','k'),
269          ),          ),
270          'c', suffix(          'c', suffix(
271                  ( rec('200','f') && rec('200','c') ) ? '. ' :                  ( rec('200','f') && rec('200','c') ) ? '.' :
272                          '',                          '',
273                          rec('200','f'),                          rec('200','f'),
274          ),          ),
275          '+', rec('200','c'),          '+', suffix('.',
276                    rec('200','c'),
277            )
278  );  );
279    
280  ### 246 inikatori  ### 246 inikatori
# Line 345  marc('300','e', Line 378  marc('300','e',
378  );  );
379    
380  ### 310 - current stated publication frequency  ### 310 - current stated publication frequency
381  # potrebno ujednačiti, polje 008?  # potrebno ujednačiti, koristi se i u polju 008
382    
383  marc('310','a',  marc('310','a',
384          rec('326')          rec('326')
# Line 414  marc('490','x', Line 447  marc('490','x',
447          rec('225','x')          rec('225','x')
448  );  );
449    
450  #if ( rec('225','a') && rec('11') ) {  if ( rec('11') ) {
451  #       marc('999','a',          marc('999','a',
452  #               lookup(                  lookup(
453  #                       sub { rec('110','a'), },                          sub { rec('110','a'), },
454  #                       'nsk','bbaza',                          'nsk','bbaza',
455  #                       sub { rec('011','a') },                          sub { rec('011','a') },
456  #                       sub { rec('11') }                          sub { rec('11') }
457  #               )                  )
458  #       );          );
459  #}  }
460    
461    
462    #marc('998','a',
463    #       lookup(
464    #               sub { rec('H') },
465    #               'ffsf','xls',
466    #               sub { rec('A') },
467    #               sub { $id },
468    #       ),
469    #);
470    
471    
472  ### 5xx  ### 5xx
473  # koje podatke povući iz drugih baza?  # koje podatke povući iz drugih baza?
# Line 549  marc('772','t', Line 591  marc('772','t',
591          rec('422','a'),          rec('422','a'),
592  );  );
593    
594    ### 773 indikatori
595    
596    if ( rec('225','a') ) {
597    
598    marc_indicators('773', 0, ' ');
599    
600    ### 773
601    ## da li je bitan redoslijed potpolja?
602    
603    marc('773','w',
604            lookup(
605                    sub { rec('000') },
606                    'ffsf','peri',
607                    sub { rec('200','a') },
608                    sub {
609                            regex('s/ ; //g',
610                                    rec('225','a')
611                            )
612                    },
613            )
614    );
615    
616    }
617    
618    
619  ### 777 indikatori  ### 777 indikatori
620    
621  marc_indicators('777', 0, ' ');  marc_indicators('777', 0, ' ');
622    
623  ### 777  ### 777
624    
625  marc('777','t',  marc('777','t',
626          rec('423','a'),          rec('423','a'),
627  );  );
# Line 645  marc('992','a', Line 713  marc('992','a',
713  #       )  #       )
714  # );  # );
715    
716  } # 200a  }# 200a

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

  ViewVC Help
Powered by ViewVC 1.1.26