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

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

revision 73 by dpavlin, Thu Jun 20 07:57:05 2002 UTC revision 74 by dpavlin, Tue Jun 25 15:06:47 2002 UTC
# Line 5  use CGI qw/:standard -no_xhtml/; Line 5  use CGI qw/:standard -no_xhtml/;
5  use Text::Query;  use Text::Query;
6  use CGI::Carp qw(fatalsToBrowser);  use CGI::Carp qw(fatalsToBrowser);
7  use SWISH;  use SWISH;
8    use Unicode::String qw(utf8 utf16);
9  require Unicode::Map8;  require Unicode::Map8;
10    
11  my $dir='/home/dpavlin/nn/swish';  my $dir='/home/dpavlin/nn/swish';
# Line 23  if (param('search')) { Line 24  if (param('search')) {
24          $s=~tr/¹©ðÐèÈæƾ®/sSdDcCcCzZ/;          $s=~tr/¹©ðÐèÈæƾ®/sSdDcCcCzZ/;
25    
26          my $l2_map = Unicode::Map8->new("ISO-8859-2") || die;          my $l2_map = Unicode::Map8->new("ISO-8859-2") || die;
27          #my $utf8_map = Unicode::Map8->new("utf8") || die;          my $us = Unicode::String->new();
28    
29          my $sh = SWISH->connect('Fork',          my $sh = SWISH->connect('Fork',
30                  prog     => "$dir/swish-e",                  prog     => "$dir/swish-e",
# Line 32  if (param('search')) { Line 33  if (param('search')) {
33                  results  => sub {                  results  => sub {
34                          my ($sh,$hit) = @_;                          my ($sh,$hit) = @_;
35    
36                          my $us=$hit->swishtitle;                          $us->utf8($hit->swishtitle);
37    
38                          print "<a href=\"",$hit->swishdocpath,"\"><tt>NN",$hit->god,"/",$hit->br,"</a> ",$hit->nr," </tt>",$hit->swishtitle,"</a> [",$hit->swishrank,"]<br>\n";                          print "<a href=\"",$hit->swishdocpath,"\"><tt>NN",$hit->god,"/",$hit->br,"</a> ",$hit->nr," </tt>",$l2_map->to8($us->utf16),"</a> [",$hit->swishrank,"]<br>\n";
39    
40  #                       print $_[1]->as_string,"<br>\n";  #                       print $_[1]->as_string,"<br>\n";
41  #                       my @fields = $hit->field_names;  #                       my @fields = $hit->field_names;

Legend:
Removed from v.73  
changed lines
  Added in v.74

  ViewVC Help
Powered by ViewVC 1.1.26