14 |
|
|
15 |
my $db_dir = $opts{d}; |
my $db_dir = $opts{d}; |
16 |
|
|
17 |
mkdir "$common::install_dir/$db_dir" if (!-e "$common::install_dir/$db_dir"); |
my $dir = open_data_files($db_dir); |
|
mkdir "$common::install_dir/$db_dir/data" if (!-e "$common::install_dir/$db_dir/data"); |
|
|
|
|
|
my $dir="$common::install_dir/$db_dir/data"; |
|
|
|
|
|
|
|
|
open(S,"> $dir/stream") || die "can't open output $dir/stream: $!"; |
|
|
open(R,"> $dir/bib") || die "can't open output $dir/bib: $!"; |
|
|
open(MPS,"| $common::mpsindex -d $common::install_dir/$db_dir -autokey") || die "can't start MPS indexer $common::mpsindex: $!"; |
|
|
#open(MPS,"> /tmp/mpsindex") || die "mps: $!"; |
|
|
|
|
|
print S $common::mps_header; |
|
|
print MPS $common::mps_header; |
|
18 |
|
|
19 |
#-------------------------------------------------------------------- |
#-------------------------------------------------------------------- |
20 |
# init array in_mps_header for config checks later |
# init array in_mps_header for config checks later |
58 |
foreach my $w (@words) { |
foreach my $w (@words) { |
59 |
# FIX: this should be replaced by stemmer! |
# FIX: this should be replaced by stemmer! |
60 |
#$w =~ tr/ƾ/sSdDcCcCzZ/; |
#$w =~ tr/ƾ/sSdDcCcCzZ/; |
61 |
$w =~ tr/ܫȺ̪/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'-".'',"'Rr/; |
$w =~ tr/ܫȺ̪/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'".'',"'Rr/; |
62 |
$w =~ s//ss/g; |
$w =~ s//ss/g; |
63 |
$out .= "W $w $nr\n"; |
$out .= "W $w $nr\n"; |
64 |
} |
} |
83 |
sub c_852_czs { |
sub c_852_czs { |
84 |
my $tmp = $_[0]; |
my $tmp = $_[0]; |
85 |
$tmp =~ tr//ܫꔼȺ̪㍐슂ٝ/; |
$tmp =~ tr//ܫꔼȺ̪㍐슂ٝ/; |
86 |
$tmp =~ tr/ܫȺ̪/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'-".'',"'Rr/; |
$tmp =~ tr/ܫȺ̪/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'".'',"'Rr/; |
87 |
$tmp =~ s//ss/g; |
$tmp =~ s//ss/g; |
88 |
return $tmp; |
return $tmp; |
89 |
} |
} |
126 |
my @sf_arr = subfields_str_2_arr($subfields,$sf_hash); |
my @sf_arr = subfields_str_2_arr($subfields,$sf_hash); |
127 |
|
|
128 |
foreach (@sf_arr) { |
foreach (@sf_arr) { |
129 |
$out.=mps_expand($mps_id,$sf_hash->{$_}); |
$out.=mps_expand($mps_id,c_852_iso($sf_hash->{$_})); |
130 |
} |
} |
131 |
return $out; |
return $out; |
132 |
} |
} |
152 |
if (scalar keys %{$sf_hash} > 0) { |
if (scalar keys %{$sf_hash} > 0) { |
153 |
if ($subfields) { |
if ($subfields) { |
154 |
foreach (split(//,$subfields)) { |
foreach (split(//,$subfields)) { |
155 |
$out.=mps_expand($mps_id,$sf_hash->{$_}); |
$out.=mps_expand($mps_id,c_852_iso($sf_hash->{$_})); |
156 |
} |
} |
157 |
} else { |
} else { |
158 |
foreach (keys %{$sf_hash}) { |
foreach (keys %{$sf_hash}) { |
159 |
$out.=mps_expand($mps_id,$sf_hash->{$_}); |
$out.=mps_expand($mps_id,c_852_iso($sf_hash->{$_})); |
160 |
} |
} |
161 |
} |
} |
162 |
} else { |
} else { |
163 |
$out.=mps_expand($mps_id,$row->{$isis_id}->[$i]); |
$out.=mps_expand($mps_id,c_852_iso($row->{$isis_id}->[$i])); |
164 |
} |
} |
165 |
$i++; |
$i++; |
166 |
} |
} |
593 |
|
|
594 |
$mps .= "E\n"; |
$mps .= "E\n"; |
595 |
|
|
|
|
|
596 |
print S $mps; |
print S $mps; |
597 |
print MPS $mps; |
print MPS $mps; |
598 |
} |
} |