/[webpac]/trunk2/all2all.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 /trunk2/all2all.pl

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

revision 549 by dpavlin, Tue Oct 26 20:53:03 2004 UTC revision 566 by dpavlin, Sun Oct 31 18:43:33 2004 UTC
# Line 36  my $result = GetOptions( Line 36  my $result = GetOptions(
36  my $filter = {  my $filter = {
37          'CROVOC' => sub {          'CROVOC' => sub {
38                  my $tmp = shift || return;                  my $tmp = shift || return;
39                  return undef unless ($tmp =~ s/\s*CROVOC.*$/ */);                  $tmp =~ s/\s*HIDRA.*//;
40                    return undef unless ($tmp =~ s/\s*CROVOC.*$/ #C#/);
41                    # remove repeating stars
42                    # FIXME this should be fixed at right place, not here!
43                    $tmp =~ s/(\s*#C#)+/ #C#/g;
44                  return $tmp;                  return $tmp;
45          },          },
46          'CROVOC_tree' => sub {          'CROVOC_tree' => sub {
47                  my $tmp = shift || return;                  my $tmp = shift || return;
48                  $tmp =~ s/\s*CROVOC.*$/ */;                  $tmp =~ s/\s*CROVOC.*$/ <img src="img\/crovoc.png" border="0">/;
49                  $tmp =~ s/\s*EUROVOC.*//;                  $tmp =~ s/\s*EUROVOC.*//;
50                    $tmp =~ s/\s*HIDRA.*//;
51                  return $tmp;                  return $tmp;
52          },          },
53            # TT filter
54            'CROVOC_img' => sub {
55                    my $tmp = shift;
56                    $tmp =~ s/\s*#C#\s*/ <img src="..\/img\/crovoc.png" border="0">/gis;
57                    $tmp =~ s/"img\/crovoc.png"/"..\/img\/crovoc.png"/gis;
58                    return $tmp;
59            }
60  };  };
61    
62  ## remove accented characters  ## remove accented characters
# Line 53  sub unac { Line 65  sub unac {
65          my $string = shift || return;          my $string = shift || return;
66          $string = unac_string($code_page,$string);          $string = unac_string($code_page,$string);
67          $string =~ tr/ðÐ/dD/;          $string =~ tr/ðÐ/dD/;
68            $string = unac_entities($string);
69          return $string;          return $string;
70  }  }
71  sub unac_2 {  sub unac_2 {
# Line 63  sub unac_2 { Line 76  sub unac_2 {
76                  $string =~ tr/ðÐ/dD/;                  $string =~ tr/ðÐ/dD/;
77                  $string = $pr . $string;                  $string = $pr . $string;
78          }          }
79          $string =~ s/&(\w)(acute|cedil|circ|grave|ring|slash|tilde|uml);/$1/gi;          $string = unac_entities($string);
         $string =~ s/&eth;/d/g;  
         $string =~ s/&E[tT][hH];/D/g;  
         $string =~ s/&(\w\w)lig;/$1/gi;  
80          return lc($string);          return lc($string);
81  }  }
82    
83    sub unac_entities {
84            my $ent = shift || return;
85    
86            $ent =~ s/&(\w)(acute|cedil|circ|grave|ring|slash|tilde|uml);/$1/gi;
87            $ent =~ s/&eth;/d/g;
88            $ent =~ s/&E[tT][hH];/D/g;
89            $ent =~ s/&(\w\w)lig;/$1/gi;
90    
91            return $ent;
92    }
93    
94  # create WebPAC object  # create WebPAC object
95  #  #
96  my $webpac = new WebPAC(  my $webpac = new WebPAC(
# Line 87  $log->debug("creating WebPAC::jsFind obj Line 108  $log->debug("creating WebPAC::jsFind obj
108    
109  my $index = new WebPAC::jsFind(  my $index = new WebPAC::jsFind(
110          index_path => $index_path,          index_path => $index_path,
111          keys => 10,          keys => 62,
112  ) || die;  ) || die;
113    
114  my $thes;  my $thes;

Legend:
Removed from v.549  
changed lines
  Added in v.566

  ViewVC Help
Powered by ViewVC 1.1.26