/[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 560 by dpavlin, Sat Oct 30 23:04:37 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.*$/ */);                  return undef unless ($tmp =~ s/\s*CROVOC.*$/ #C#/);
40                    # remove repeating stars
41                    # FIXME this should be fixed at right place, not here!
42                    $tmp =~ s/(\s*#C#)+/ #C#/g;
43                  return $tmp;                  return $tmp;
44          },          },
45          'CROVOC_tree' => sub {          'CROVOC_tree' => sub {
46                  my $tmp = shift || return;                  my $tmp = shift || return;
47                  $tmp =~ s/\s*CROVOC.*$/ */;                  $tmp =~ s/\s*CROVOC.*$/ #C#/;
48                  $tmp =~ s/\s*EUROVOC.*//;                  $tmp =~ s/\s*EUROVOC.*//;
49                  return $tmp;                  return $tmp;
50          },          },
51            # TT filter
52            'CROVOC_img' => sub {
53                    my $tmp = shift;
54                    $tmp =~ s/\s*#C#\s*/ <img src="..\/img\/crovoc.png" border="0">/gis;
55                    return $tmp;
56            }
57  };  };
58    
59  ## remove accented characters  ## remove accented characters
# Line 53  sub unac { Line 62  sub unac {
62          my $string = shift || return;          my $string = shift || return;
63          $string = unac_string($code_page,$string);          $string = unac_string($code_page,$string);
64          $string =~ tr/ðÐ/dD/;          $string =~ tr/ðÐ/dD/;
65            $string = unac_entities($string);
66          return $string;          return $string;
67  }  }
68  sub unac_2 {  sub unac_2 {
# Line 63  sub unac_2 { Line 73  sub unac_2 {
73                  $string =~ tr/ðÐ/dD/;                  $string =~ tr/ðÐ/dD/;
74                  $string = $pr . $string;                  $string = $pr . $string;
75          }          }
76          $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;  
77          return lc($string);          return lc($string);
78  }  }
79    
80    sub unac_entities {
81            my $ent = shift || return;
82    
83            $ent =~ s/&(\w)(acute|cedil|circ|grave|ring|slash|tilde|uml);/$1/gi;
84            $ent =~ s/&eth;/d/g;
85            $ent =~ s/&E[tT][hH];/D/g;
86            $ent =~ s/&(\w\w)lig;/$1/gi;
87    
88            return $ent;
89    }
90    
91  # create WebPAC object  # create WebPAC object
92  #  #
93  my $webpac = new WebPAC(  my $webpac = new WebPAC(
# Line 87  $log->debug("creating WebPAC::jsFind obj Line 105  $log->debug("creating WebPAC::jsFind obj
105    
106  my $index = new WebPAC::jsFind(  my $index = new WebPAC::jsFind(
107          index_path => $index_path,          index_path => $index_path,
108          keys => 10,          keys => 62,
109  ) || die;  ) || die;
110    
111  my $thes;  my $thes;

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

  ViewVC Help
Powered by ViewVC 1.1.26