8 |
|
|
9 |
my %opts; |
my %opts; |
10 |
|
|
11 |
getopt('dm', \%opts); |
getopts('d:m:q', \%opts); |
12 |
|
|
13 |
die "usage: $0 -d [database_dir] -m [database1,database2] " if (! %opts); |
die "usage: $0 -d [database_dir] -m [database1,database2] " if (! %opts); |
14 |
|
|
84 |
return $tmp; |
return $tmp; |
85 |
} |
} |
86 |
|
|
87 |
|
sub c_iso_852 { |
88 |
|
my $tmp = $_[0]; |
89 |
|
$tmp =~ tr/ܫꔼȺ̪㍐슂ٝ// if ($tmp); |
90 |
|
return $tmp; |
91 |
|
} |
92 |
|
|
93 |
sub c_852_czs { |
sub c_852_czs { |
94 |
my $tmp = $_[0]; |
my $tmp = $_[0]; |
95 |
$tmp =~ tr//ܫꔼȺ̪㍐슂ٝ/; |
$tmp =~ tr//ܫꔼȺ̪㍐슂ٝ/; |
330 |
|
|
331 |
my $pcnt = int($row->{mfn} * 100 / $max_rowid); |
my $pcnt = int($row->{mfn} * 100 / $max_rowid); |
332 |
if ($pcnt != $last_pcnt) { |
if ($pcnt != $last_pcnt) { |
333 |
printf MPS ("M %5d / %5d -- %-2d %%\n",$row->{mfn},$max_rowid,$pcnt); |
printf MPS ("M %5d / %5d -- %-2d %%\n",$row->{mfn},$max_rowid,$pcnt) if (! $opts{q}); |
334 |
$last_pcnt = $pcnt; |
$last_pcnt = $pcnt; |
335 |
} |
} |
336 |
|
|
340 |
$headline .= isis_sf($row,'200','f'," / "); |
$headline .= isis_sf($row,'200','f'," / "); |
341 |
$headline .= isis_sf($row,'210','d'," , "); |
$headline .= isis_sf($row,'210','d'," , "); |
342 |
|
|
343 |
|
# remove newlines, compress spaces |
344 |
|
$headline =~ s/[\n\r]//g; |
345 |
|
$headline =~ s/^\s+//g; |
346 |
|
$headline =~ s/\s+$//g; |
347 |
|
|
348 |
# author |
# author |
349 |
$bib .= isis_to_bib($row,'700','%700+','*',2,'<'); |
$bib .= isis_to_bib($row,'700','%700+','*',2,'>',', '); |
350 |
$bib .= isis_to_bib($row,'701','%700+','*',2,'<'); |
$bib .= isis_to_bib($row,'701','%700+','*',2,'>',', '); |
351 |
$bib .= isis_to_bib($row,'710','%700+','*',2,'<'); |
$bib .= isis_to_bib($row,'710','%700+','*',2,'>',', '); |
352 |
$bib .= isis_to_bib($row,'711','%700+','*',2,'<'); |
$bib .= isis_to_bib($row,'711','%700+','*',2,'>',', '); |
353 |
$bib .= isis_to_bib($row,'503','%700+','*',2,'<'); |
$bib .= isis_to_bib($row,'503','%700+','*',2,'>',', '); |
354 |
|
|
355 |
$mps .= isis_to_mps($row,'700',1); |
$mps .= isis_to_mps($row,'700',1); |
356 |
$mps .= isis_to_mps($row,'701',1); |
$mps .= isis_to_mps($row,'701',1); |
437 |
if (my $year = isis_sf($row,'210','d')) { |
if (my $year = isis_sf($row,'210','d')) { |
438 |
$year =~ s/^\s*cop\.*\s*//i; |
$year =~ s/^\s*cop\.*\s*//i; |
439 |
$year =~ s/[\[\]]*//g; |
$year =~ s/[\[\]]*//g; |
440 |
|
$year =~ s/[\n\r]//g; # remove cr |
441 |
$mps .= "D ${year}\n" if ($year !~ m/\?/ && $year =~ /\d{4}/); |
$mps .= "D ${year}\n" if ($year !~ m/\?/ && $year =~ /\d{4}/); |
442 |
} |
} |
443 |
|
|
491 |
my $mps=''; |
my $mps=''; |
492 |
while (my $isn=$row->{$isis_id}->[$i]) { |
while (my $isn=$row->{$isis_id}->[$i]) { |
493 |
$isn =~ s/ +//g; # remove spaces |
$isn =~ s/ +//g; # remove spaces |
494 |
|
$isn =~ s/[\n\r]//g; # remove cr |
495 |
$mps .= "W $isn $nr\n"; |
$mps .= "W $isn $nr\n"; |
496 |
if ($isn =~ s/-//g) { |
if ($isn =~ s/-//g) { |
497 |
$mps .= "W $isn $nr\n"; |
$mps .= "W $isn $nr\n"; |
522 |
$headline =~ s/&/∧/g; |
$headline =~ s/&/∧/g; |
523 |
$headline =~ s/</</g; |
$headline =~ s/</</g; |
524 |
$headline =~ s/>/>/g; |
$headline =~ s/>/>/g; |
|
$headline =~ s/<(\/?[bi])>/<$1>/g; |
|
525 |
$mps .= "H ".c_852_iso($headline)."\n"; |
$mps .= "H ".c_852_iso($headline)."\n"; |
526 |
} else { |
} else { |
527 |
$mps .= "H nepoznato\n"; |
$mps .= "H nepoznato\n"; |