/[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.4 by dpavlin, Sun Jun 16 19:39:42 2002 UTC revision 1.8 by dpavlin, Mon Jun 24 18:07:26 2002 UTC
# Line 26  F 991 12 Inventarni broj Line 26  F 991 12 Inventarni broj
26  F ISBN 13 ISBN  F ISBN 13 ISBN
27  F MFN 14 MFN  F MFN 14 MFN
28  F 215+ 15 Materijalni opis  F 215+ 15 Materijalni opis
29    F 101 16 Jezik
30  ";  ";
31    
32    $common::database_cf="/local/search/databases.cf";
33    
34  #--------------------------------------------------------------------  #--------------------------------------------------------------------
35  #  #
36  # mps_expand(nr,"space separated string");  # mps_expand(nr,"space separated string");
# Line 38  sub mps_expand { Line 41  sub mps_expand {
41          my $out = "";          my $out = "";
42          while (my $fld = shift @_) {          while (my $fld = shift @_) {
43                  if ($fld =~ s/\s*[,;\.!?'"<>\[\]]*\s+/ /g) {                  if ($fld =~ s/\s*[,;\.!?'"<>\[\]]*\s+/ /g) {
44                            $fld =~ s/></ /g;
45                          foreach my $w (split(/\s+/,$fld)) {                          foreach my $w (split(/\s+/,$fld)) {
46                                  # FIX: this should be replaced by stemmer!                                  # FIX: this should be replaced by stemmer!
47                                  $out .= "W $w $nr\n";                                  # remove chars from beginning of word
48                                    $w =~ s/^['"<(\[]//g;
49                                    # remove chars from end of word
50                                    $w =~ s/[,;\.!?'">)\]]$//g;
51                                    # preglasi φΦδΔόά -> ”™„Žš
52                                    if ($w =~ m/[”™„Žš]/) {
53                                            $out .= "W $w $nr\n";
54                                            $w =~ s/[”™]/oe/g;
55                                            $w =~ s/[„Ž]/ae/g;
56                                            $w =~ s/[š]/ue/g;
57                                            $out .= "W $w $nr\n";
58                                    # Irish Last names
59                                    } elsif (($nr == 1 || $nr == 2 || $nr == 3 || $nr == 6 || $nr == 7 || $nr == 8) && $w =~ m/^Ma?c([A-Z].+)/) {
60                                            $out .= "W Mc$1 $nr\n";
61                                            $out .= "W Mac$1 $nr\n";
62                                    } else {
63                                            $out .= "W $w $nr\n";
64                                    }
65                          }                          }
66                  } else {                  } else {
67                          $out .= "W $fld $nr\n";                          $out .= "W $fld $nr\n";

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.26