/[webpac-proto]/common.pm
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 /common.pm

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

revision 1.10 by dpavlin, Mon Sep 23 18:46:21 2002 UTC revision 1.11 by dpavlin, Thu Oct 24 16:32:00 2002 UTC
# Line 35  $common::database_cf="/local/search/data Line 35  $common::database_cf="/local/search/data
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) = @_;
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            open(MPS,"| $common::mpsindex -d $common::install_dir/$db_dir -autokey") || die "can't start MPS indexer $common::mpsindex: $!";
54    #       open(MPS,"> /tmp/mpsindex") || die "mps: $!";
55    
56            print S $common::mps_header;
57            print MPS $common::mps_header;
58    
59            return $dir;
60    }
61    
62    #--------------------------------------------------------------------
63    #
64  # mps_expand(nr,"space separated string");  # mps_expand(nr,"space separated string");
65  #  #
66    
# Line 50  sub mps_expand { Line 76  sub mps_expand {
76                                  $w =~ s/^['"<(\[]//g;                                  $w =~ s/^['"<(\[]//g;
77                                  # remove chars from end of word                                  # remove chars from end of word
78                                  $w =~ s/[,;\.!?'">)\]]$//g;                                  $w =~ s/[,;\.!?'">)\]]$//g;
79                                  # preglasi ->                                  # preglasi
80                                  if ($w =~ m/[]/) {                                  if ($w =~ m/[]/) {
81                                          $out .= "W $w $nr\n";                                          $out .= "W $w $nr\n";
82                                          $w =~ s/[]/oe/g;                                          $w =~ s/[]/oe/g;
83                                          $w =~ s/[]/ae/g;                                          $w =~ s/[]/ae/g;
84                                          $w =~ s/[]/ue/g;                                          $w =~ s/[]/ue/g;
85                                          $out .= "W $w $nr\n";                                          $out .= "W $w $nr\n";
86                                  # Irish Last names                                  # Irish Last names
87                                  } 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].+)/) {
# Line 69  sub mps_expand { Line 95  sub mps_expand {
95                          $out .= "W $fld $nr\n";                          $out .= "W $fld $nr\n";
96                  }                  }
97          }          }
98          return c_852_czs($out);          return $out;
99  }  }
100    
101  1;  1;

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.26