/[webpac-proto]/isis2stream.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 /isis2stream.pl

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

revision 1.20 by dpavlin, Wed Jul 17 19:33:19 2002 UTC revision 1.22 by dpavlin, Thu Oct 24 16:32:00 2002 UTC
# Line 14  die "usage: $0 -d [database_dir] -m [dat Line 14  die "usage: $0 -d [database_dir] -m [dat
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
# Line 70  sub expand { Line 58  sub expand {
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                  }                  }
# Line 95  sub c_iso_852 { Line 83  sub c_iso_852 {
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  }  }
# Line 138  sub sf_to_mps { Line 126  sub sf_to_mps {
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  }  }
# Line 164  sub isis_to_mps { Line 152  sub isis_to_mps {
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          }          }
# Line 605  foreach my $isis_db (@isis_dbs) { Line 593  foreach my $isis_db (@isis_dbs) {
593    
594                  $mps .= "E\n";                  $mps .= "E\n";
595    
   
596                  print S $mps;                  print S $mps;
597                  print MPS $mps;                  print MPS $mps;
598          }          }

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.26