/[nn]/search/nn-swish.cgi
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 /search/nn-swish.cgi

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

revision 1.9 by dpavlin, Sat Jul 6 13:13:27 2002 UTC revision 1.12 by dpavlin, Wed Sep 3 15:34:14 2003 UTC
# Line 2  Line 2 
2    
3  use strict;  use strict;
4  use CGI qw/:standard -no_xhtml/;  use CGI qw/:standard -no_xhtml/;
 use Text::Query;  
5  use CGI::Carp qw(fatalsToBrowser);  use CGI::Carp qw(fatalsToBrowser);
6  use SWISH;  use SWISH;
7  use Unicode::String qw(utf8 utf16);  use Unicode::String qw(utf8 utf16);
8  require Unicode::Map8;  require Unicode::Map8;
9    
10  my $dir='/home/dpavlin/nn/swish';  my $dir='/home/dpavlin/nn/swish';
11    my $prog='/usr/bin/swish-e';
12    
13  my $hits=0;  my $hits=0;
14  my $max_hits=100;  my $max_hits=100;
# Line 28  if (param('search')) { Line 28  if (param('search')) {
28                  if (m/^([+-])(\S+)/) {                  if (m/^([+-])(\S+)/) {
29                          $s.= ($s) ? "and " : "";                          $s.= ($s) ? "and " : "";
30                          $s.="not " if ($1 eq "-");                          $s.="not " if ($1 eq "-");
31                          $s.="$2 ";                          $s.="$2* ";
32                  } else {                  } else {
33                          $s .= "$_ ";                          $s .= "$_* ";
34                  }                  }
35          }          }
36          $s=~tr/šðžèæŠÐŽÈÆ/¹ð¾èæ©Ð®ÈÆ/;  # 1250 -> iso8859-2          $s=~tr/šðžèæŠÐŽÈÆ/¹ð¾èæ©Ð®ÈÆ/;  # 1250 -> iso8859-2
# Line 40  if (param('search')) { Line 40  if (param('search')) {
40          my $us = Unicode::String->new();          my $us = Unicode::String->new();
41    
42          my $sh = SWISH->connect('Fork',          my $sh = SWISH->connect('Fork',
43                  prog     => "$dir/swish-e",                  prog     => $prog,
44                  indexes  => "$dir/nn.index",                  indexes  => "$dir/nn.index",
45                  properties  => [qw/god br nr/],                  properties  => [qw/god br nr/],
46                  results  => sub {                  results  => sub {

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.26