/[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 1102 by dpavlin, Mon Aug 4 19:35:05 2008 UTC revision 1103 by dpavlin, Mon Aug 4 19:35:18 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  ## LDR 17 - 3
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    
 ### 001 - Voyager ID  
   
 ### 003 - razjasniti  
   
 ### 007 - razjasniti  
   
 marc_fixed('007',00,'ta');  
   
43  ### 008 - All materials  ### 008 - All materials
44  ## dodati sve moguce slucajeve za datum, popuniti ono sto nedostaje  ## dodati sve moguce slucajeve za datum, popuniti ono sto nedostaje
45    ## ostaviti prazno tamo gdje nema ništa
46    
47  if ( rec('994','c') =~ m/\d{8}/ ) {  if ( rec('994','c') =~ m/\d{8}/ ) {
48          marc_fixed('008','00',          marc_fixed('008','00',
# Line 59  if ( rec('994','c') =~ m/\d{8}/ ) { Line 52  if ( rec('994','c') =~ m/\d{8}/ ) {
52          );          );
53  } elsif ( rec('994','c') =~ m/\d{6}/ ) {  } elsif ( rec('994','c') =~ m/\d{6}/ ) {
54          marc_fixed('008', 00,          marc_fixed('008', 00,
55                  '000000'                  regex('s/^\d\d//',
56                            rec('994','c')
57                    ),
58          );          );
59          marc_fixed('008', '04',          marc_fixed('008', '04',
60                  '01'                  '01'
# Line 85  if ( rec('994','c') =~ m/\d{8}/ ) { Line 80  if ( rec('994','c') =~ m/\d{8}/ ) {
80  ## 008 06 - Type of date/Publication status  ## 008 06 - Type of date/Publication status
81  ## dodati i ostale mogućnosti  ## dodati i ostale mogućnosti
82  ## 008 07-10 - Date 1 - iz 210d koji kroz modify postaje 210c  ## 008 07-10 - Date 1 - iz 210d koji kroz modify postaje 210c
83    ## srediti sve moguće upitne godine
 my $year = rec('210','c');  
84    
85  if ( rec('210','c') ) {  if ( rec('210','c') ) {
86          marc_fixed('008','06','s');             # 06 - Type of date/Publication status, s = single know date          my $d1;
87                    my $d2;
88  #       warn "## year = $year";          if ( rec('210','c') =~ m/\?/ ) {
89                    marc_fixed('008','06','q');
90            } else {
91                    marc_fixed('008','06','s');
92            }
93            if ( rec('210','c') =~ m/(\d{4})/ ) {
94                    $d1 = $1;
95            } else {
96                    $d1 = '';
97            }
98            if ( rec('210','c') =~ m/^.*-(\d{4})/ ) {
99                    $d2 = $1;
100            } else {
101                    $d2 = '',
102            }
103            if ( rec('210','c') =~ m/(\d{2})--/ ) {
104                    $d1 = $1.'uu';
105                    marc_fixed('008','06','u');
106            }
107    
108          if ( $year =~ m/^(\d{4})/ ) {          marc_fixed('008','07',$d1);             # 07-10 - Date 1
109  #       warn "## $1 ##\n";          marc_fixed('008','11',$d2);             # 07-10 - Date 1
                 marc_fixed('008','07',$1);              # 07-10 - Date 1  
110    
111  } else {  } else {
112          marc_fixed('008','06','n');             # 06 - n = unknown date          marc_fixed('008','06','n');             # 06 - n = unknown date
113          marc_fixed('008','07','uuuu');          marc_fixed('008','07','uuuu');
114  }  }
 }  
115    
116    
117  ## 008 11-14 - Date 2  ## 008 11-14 - Date 2
# Line 109  if ( rec('210','c') ) { Line 119  if ( rec('210','c') ) {
119  ## 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?
120  ## raspraviti  ## raspraviti
121    
122    marc_fixed('008','15','xx');
123    
124  #marc_fixed('008','15',  #marc_fixed('008','15',
125  #       lc ( rec('102') )  #       lc ( rec('102') )
126  #);  #);
127    
128  my $zemlja =  #my $zemlja =
129          lookup(  #       lookup(
130                  sub { rec('B') },  #               sub { rec('B') },
131                  'kodovi','zemlje',  #               'kodovi','zemlje',
132                  sub { rec('A') },  #               sub { rec('A') },
133                  sub {  #               sub {
134                          regex('s/[\s;:]/g',  #                       regex('s/[\s;:]/g',
135                                  rec('210','a')  #                               rec('210','a')
136                          )  #                       )
137                  },  #               },
138          );  #       );
   
 warn (  
         dump ($zemlja)  
 );  
   
 if ( $year =~ m/^(\d{4})/ ) {  
         if ( $1 >= 1990 ) {  
                 marc_fixed('008','15',  
                         lc ( $zemlja )  
   
                 );  
 #       } elsif ( dump( $zemlja ) eq 'hr' ) {  
 #               marc_fixed('008','15','yu');  
         }  
 }  
139    
140    
141  ## 008 35-37 - Language  ## 008 35-37 - Language
   
142  marc_fixed('008','35',  marc_fixed('008','35',
143          # first( lc(rec('101')) )                        # first( lc(rec('101')) )              
144          lc( frec('101'))                          lc( frec('101'))                
# Line 152  marc_fixed('008','35', Line 148  marc_fixed('008','35',
148  marc_fixed('008','38','|');              marc_fixed('008','38','|');            
149    
150  ## 008 39 - Cataloging source - d (other)  ## 008 39 - Cataloging source - d (other)
   
151  marc_fixed('008','39','d');              marc_fixed('008','39','d');            
152    
153  ### 008 - Books - raspraviti upotrebu ovih polja  ### 008 - Books - raspraviti upotrebu ovih polja
# Line 192  marc_fixed('008','34','|'); Line 187  marc_fixed('008','34','|');
187  ## 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)
188    
189  if ( frec('10') ne ( frec('290') ) ) {  if ( frec('10') ne ( frec('290') ) ) {
190          marc('020','a',          if ( rec('10','a') !~ /pogre/ ) {
191                  # isbn_13(                  marc('020','a',
192                            # isbn_13(
193                                    regex('s/\s\s/ /g',
194                                    # regex('s/\(\d\)\(/$1 \(//g',
195                                            rec('10','a')
196                                    )
197                            # )
198                    );
199            }
200            if ( rec('10','a') =~ /pogre/ ) {
201                    marc('020','z',
202                          regex('s/\s\s/ /g',                          regex('s/\s\s/ /g',
                         # regex('s/\(\d\)\(/$1 \(//g',  
203                                  rec('10','a')                                  rec('10','a')
204                          )                          )
205                  # )                  );
206          );          }
207            marc('020','z',
208                    rec('10','z')
209            );
210                            
211  }  }
212    
213  #warn(  #warn(
# Line 217  marc('035','a', Line 225  marc('035','a',
225  join_with('',  join_with('',
226          # config('input normalize path'),          # config('input normalize path'),
227          # config('name'),          # config('name'),
228            'HR-ZaFF ',
229          config(),          config(),
230          ' L',          'L-',
231          # config('input name'),          # config('input name'),
232          # id(),          # id(),
233          # rec('994','a'),          # rec('994','a'),
# Line 669  marc_template( Line 678  marc_template(
678                  'a.|i ;|w',                  'a.|i ;|w',
679                  # greške                  # greške
680                  'a ;|v ;|w',                  'a ;|v ;|w',
681                  #mozda greska:                  'a.|h',
682                  'a ;|v,|x ;|w',                  'a.|h ;|w',
683                  'a ;|v,|x.|p',                  'a.|h ;|v',
684                  'a,|x ;|v',                  'h,|i',
685                  'a,|x.|p ;|w',                  'h ;|v',
686          ],                  'i ;|w',
687            from => "{ a => 1, i => 1, w => 1, \"x\" => 1 }",                  'v',    
688              to => "{ a => 1, p => 1, v => 1, \"x\" => 1 }",                  'w',
689    
         marc_template => [  
                 'a',  
                 'a ;|v',  
                 'a,|x',  
                 'a.|n',         # mozda greska  
                 'a.|n,|p',  
                 'a.|p',  
                 'a ;|v.|n',  
                 'a ;|v.|n,|p',  # mozda greska  
                 'n,|p',  
                 'n ;|v',        # mozda greska  
                 'p ;|v',  
                 'v',  
                 'x',  
                 'x ;|v'         # greska  
690          ],          ],
691  );  );
692    

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

  ViewVC Help
Powered by ViewVC 1.1.26