6 |
|
|
7 |
$common::install_dir="/local/index"; |
$common::install_dir="/local/index"; |
8 |
$common::mpsindex="/local/mps-5.3/bin/mpsindex -l 9 -b"; |
$common::mpsindex="/local/mps-5.3/bin/mpsindex -l 9 -b"; |
9 |
$common::isis_data="/var/autofs/misc/isis_data/"; |
#$common::isis_data="/var/autofs/misc/isis_data/"; |
10 |
|
$common::isis_data="/data/isis_data/"; |
11 |
#$common::isis_data="/mnt/20020606/Isis/Data/"; # doma |
#$common::isis_data="/mnt/20020606/Isis/Data/"; # doma |
12 |
|
|
13 |
$common::mps_header="V 5 3 |
$common::mps_header="V 5 3 |
35 |
|
|
36 |
#-------------------------------------------------------------------- |
#-------------------------------------------------------------------- |
37 |
# |
# |
38 |
|
# open_data_files($db_dir) |
39 |
|
# |
40 |
|
# input: $db_dir - database directory name (e.g. 'ps') |
41 |
|
# return: path on filesystem to data dir |
42 |
|
|
43 |
|
sub open_data_files { |
44 |
|
my ($db_dir,$debug) = @_; |
45 |
|
|
46 |
|
mkdir "$common::install_dir/$db_dir" if (!-e "$common::install_dir/$db_dir"); |
47 |
|
mkdir "$common::install_dir/$db_dir/data" if (!-e "$common::install_dir/$db_dir/data"); |
48 |
|
|
49 |
|
my $dir="$common::install_dir/$db_dir/data"; |
50 |
|
|
51 |
|
open(S,"> $dir/stream") || die "can't open output $dir/stream: $!"; |
52 |
|
open(R,"> $dir/bib") || die "can't open output $dir/bib: $!"; |
53 |
|
if (! $debug) { |
54 |
|
open(MPS,"| $common::mpsindex -d $common::install_dir/$db_dir -autokey") || die "can't start MPS indexer $common::mpsindex: $!"; |
55 |
|
} else { |
56 |
|
open(MPS,"> /tmp/mpsindex") || die "mps: $!"; |
57 |
|
} |
58 |
|
|
59 |
|
print S $common::mps_header; |
60 |
|
print MPS $common::mps_header; |
61 |
|
|
62 |
|
return $dir; |
63 |
|
} |
64 |
|
|
65 |
|
#-------------------------------------------------------------------- |
66 |
|
# |
67 |
# mps_expand(nr,"space separated string"); |
# mps_expand(nr,"space separated string"); |
68 |
# |
# |
69 |
|
|
79 |
$w =~ s/^['"<(\[]//g; |
$w =~ s/^['"<(\[]//g; |
80 |
# remove chars from end of word |
# remove chars from end of word |
81 |
$w =~ s/[,;\.!?'">)\]]$//g; |
$w =~ s/[,;\.!?'">)\]]$//g; |
82 |
# preglasi -> |
# preglasi |
83 |
if ($w =~ m/[]/) { |
if ($w =~ m/[]/) { |
84 |
$out .= "W $w $nr\n"; |
$out .= "W $w $nr\n"; |
85 |
$w =~ s/[]/oe/g; |
$w =~ s/[]/oe/g; |
86 |
$w =~ s/[]/ae/g; |
$w =~ s/[]/ae/g; |
87 |
$w =~ s/[]/ue/g; |
$w =~ s/[]/ue/g; |
88 |
$out .= "W $w $nr\n"; |
$out .= "W $w $nr\n"; |
89 |
# Irish Last names |
# Irish Last names |
90 |
} elsif (($nr == 1 || $nr == 2 || $nr == 3 || $nr == 6 || $nr == 7 || $nr == 8) && $w =~ m/^Ma?c([A-Z].+)/) { |
} elsif (($nr == 1 || $nr == 2 || $nr == 3 || $nr == 6 || $nr == 7 || $nr == 8) && $w =~ m/^Ma?c([A-Z].+)/) { |
98 |
$out .= "W $fld $nr\n"; |
$out .= "W $fld $nr\n"; |
99 |
} |
} |
100 |
} |
} |
101 |
return c_852_czs($out); |
return $out; |
102 |
} |
} |
103 |
|
|
104 |
1; |
1; |