/[webpac2]/trunk/conf/normalize/ff-libri.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-libri.pl

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

revision 1101 by dpavlin, Fri Aug 1 23:41:47 2008 UTC revision 1102 by dpavlin, Mon Aug 4 19:35:05 2008 UTC
# Line 27  if ( rec('999','a') && rec('999','a') =~ Line 27  if ( rec('999','a') && rec('999','a') =~
27    
28          marc_leader('07','m');          marc_leader('07','m');
29    
30  ## LDR 17 - 3  ## LDR 17
31          marc_leader('17','7');          marc_leader('17','7');
32    
33  ## LDR 18  ## LDR 18
# Line 40  if ( rec('230') | rec('231') | rec('232' Line 40  if ( rec('230') | rec('231') | rec('232'
40          marc_leader('19','a');          marc_leader('19','a');
41  }  }
42    
43    ### 001 - Voyager ID
44    
45    ### 003 - razjasniti
46    
47    ### 007 - razjasniti
48    
49    marc_fixed('007',00,'ta');
50    
51  ### 008 - All materials  ### 008 - All materials
52  ## dodati sve moguce slucajeve za datum, popuniti ono sto nedostaje  ## dodati sve moguce slucajeve za datum, popuniti ono sto nedostaje
 ## ostaviti prazno tamo gdje nema ništa  
53    
54  if ( rec('994','c') =~ m/\d{8}/ ) {  if ( rec('994','c') =~ m/\d{8}/ ) {
55          marc_fixed('008','00',          marc_fixed('008','00',
# Line 52  if ( rec('994','c') =~ m/\d{8}/ ) { Line 59  if ( rec('994','c') =~ m/\d{8}/ ) {
59          );          );
60  } elsif ( rec('994','c') =~ m/\d{6}/ ) {  } elsif ( rec('994','c') =~ m/\d{6}/ ) {
61          marc_fixed('008', 00,          marc_fixed('008', 00,
62                  regex('s/^\d\d//',                  '000000'
                         rec('994','c')  
                 ),  
63          );          );
64          marc_fixed('008', '04',          marc_fixed('008', '04',
65                  '01'                  '01'
# Line 80  if ( rec('994','c') =~ m/\d{8}/ ) { Line 85  if ( rec('994','c') =~ m/\d{8}/ ) {
85  ## 008 06 - Type of date/Publication status  ## 008 06 - Type of date/Publication status
86  ## dodati i ostale mogućnosti  ## dodati i ostale mogućnosti
87  ## 008 07-10 - Date 1 - iz 210d koji kroz modify postaje 210c  ## 008 07-10 - Date 1 - iz 210d koji kroz modify postaje 210c
88  ## srediti sve moguće upitne godine  
89    my $year = rec('210','c');
90    
91  if ( rec('210','c') ) {  if ( rec('210','c') ) {
92          my $d1;          marc_fixed('008','06','s');             # 06 - Type of date/Publication status, s = single know date
93          my $d2;          
94          if ( rec('210','c') =~ m/\?/ ) {  #       warn "## year = $year";
                 marc_fixed('008','06','q');  
         } 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');  
         }  
95    
96          marc_fixed('008','07',$d1);             # 07-10 - Date 1          if ( $year =~ m/^(\d{4})/ ) {
97          marc_fixed('008','11',$d2);             # 07-10 - Date 1  #       warn "## $1 ##\n";
98                    marc_fixed('008','07',$1);              # 07-10 - Date 1
99    
100  } else {  } else {
101          marc_fixed('008','06','n');             # 06 - n = unknown date          marc_fixed('008','06','n');             # 06 - n = unknown date
102          marc_fixed('008','07','uuuu');          marc_fixed('008','07','uuuu');
103  }  }
104    }
105    
106    
107  ## 008 11-14 - Date 2  ## 008 11-14 - Date 2
# Line 119  if ( rec('210','c') ) { Line 109  if ( rec('210','c') ) {
109  ## 008 15-17 - Place of publication, production, or execution - što ako nema 102?  ## 008 15-17 - Place of publication, production, or execution - što ako nema 102?
110  ## raspraviti  ## raspraviti
111    
 marc_fixed('008','15','xx');  
   
112  #marc_fixed('008','15',  #marc_fixed('008','15',
113  #       lc ( rec('102') )  #       lc ( rec('102') )
114  #);  #);
115    
116  #my $zemlja =  my $zemlja =
117  #       lookup(          lookup(
118  #               sub { rec('B') },                  sub { rec('B') },
119  #               'kodovi','zemlje',                  'kodovi','zemlje',
120  #               sub { rec('A') },                  sub { rec('A') },
121  #               sub {                  sub {
122  #                       regex('s/[\s;:]/g',                          regex('s/[\s;:]/g',
123  #                               rec('210','a')                                  rec('210','a')
124  #                       )                          )
125  #               },                  },
126  #       );          );
127    
128    warn (
129            dump ($zemlja)
130    );
131    
132    if ( $year =~ m/^(\d{4})/ ) {
133            if ( $1 >= 1990 ) {
134                    marc_fixed('008','15',
135                            lc ( $zemlja )
136    
137                    );
138    #       } elsif ( dump( $zemlja ) eq 'hr' ) {
139    #               marc_fixed('008','15','yu');
140            }
141    }
142    
143    
144  ## 008 35-37 - Language  ## 008 35-37 - Language
145    
146  marc_fixed('008','35',  marc_fixed('008','35',
147          # first( lc(rec('101')) )                        # first( lc(rec('101')) )              
148          lc( frec('101'))                          lc( frec('101'))                
# Line 148  marc_fixed('008','35', Line 152  marc_fixed('008','35',
152  marc_fixed('008','38','|');              marc_fixed('008','38','|');            
153    
154  ## 008 39 - Cataloging source - d (other)  ## 008 39 - Cataloging source - d (other)
155    
156  marc_fixed('008','39','d');              marc_fixed('008','39','d');            
157    
158  ### 008 - Books - raspraviti upotrebu ovih polja  ### 008 - Books - raspraviti upotrebu ovih polja
# Line 187  marc_fixed('008','34','|'); Line 192  marc_fixed('008','34','|');
192  ## modify za polje 10 -> drugi ISBN počinje prefixom "ISBN" koji se miče (pr. u sfb)  ## modify za polje 10 -> drugi ISBN počinje prefixom "ISBN" koji se miče (pr. u sfb)
193    
194  if ( frec('10') ne ( frec('290') ) ) {  if ( frec('10') ne ( frec('290') ) ) {
195          if ( rec('10','a') !~ /pogre/ ) {          marc('020','a',
196                  marc('020','a',                  # isbn_13(
                         # isbn_13(  
                                 regex('s/\s\s/ /g',  
                                 # regex('s/\(\d\)\(/$1 \(//g',  
                                         rec('10','a')  
                                 )  
                         # )  
                 );  
         }  
         if ( rec('10','a') =~ /pogre/ ) {  
                 marc('020','z',  
197                          regex('s/\s\s/ /g',                          regex('s/\s\s/ /g',
198                            # regex('s/\(\d\)\(/$1 \(//g',
199                                  rec('10','a')                                  rec('10','a')
200                          )                          )
201                  );                  # )
202          }          );
         marc('020','z',  
                 rec('10','z')  
         );  
                           
203  }  }
204    
205  #warn(  #warn(
# Line 225  marc('035','a', Line 217  marc('035','a',
217  join_with('',  join_with('',
218          # config('input normalize path'),          # config('input normalize path'),
219          # config('name'),          # config('name'),
         'HR-ZaFF ',  
220          config(),          config(),
221          'L-',          ' L',
222          # config('input name'),          # config('input name'),
223          # id(),          # id(),
224          # rec('994','a'),          # rec('994','a'),
# Line 678  marc_template( Line 669  marc_template(
669                  'a.|i ;|w',                  'a.|i ;|w',
670                  # greške                  # greške
671                  'a ;|v ;|w',                  'a ;|v ;|w',
672                  'a.|h',                  #mozda greska:
673                  'a.|h ;|w',                  'a ;|v,|x ;|w',
674                  'a.|h ;|v',                  'a ;|v,|x.|p',
675                  'h,|i',                  'a,|x ;|v',
676                  'h ;|v',                  'a,|x.|p ;|w',
677                  'i ;|w',          ],
678                  'v',                from => "{ a => 1, i => 1, w => 1, \"x\" => 1 }",
679                  'w',              to => "{ a => 1, p => 1, v => 1, \"x\" => 1 }",
680    
681            marc_template => [
682                    'a',
683                    'a ;|v',
684                    'a,|x',
685                    'a.|n',         # mozda greska
686                    'a.|n,|p',
687                    'a.|p',
688                    'a ;|v.|n',
689                    'a ;|v.|n,|p',  # mozda greska
690                    'n,|p',
691                    'n ;|v',        # mozda greska
692                    'p ;|v',
693                    'v',
694                    'x',
695                    'x ;|v'         # greska
696          ],          ],
697  );  );
698    

Legend:
Removed from v.1101  
changed lines
  Added in v.1102

  ViewVC Help
Powered by ViewVC 1.1.26