/[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 392 by dpavlin, Wed Jul 21 16:58:27 2004 UTC revision 410 by dpavlin, Sun Sep 5 21:40:57 2004 UTC
# Line 13  use Carp; Line 13  use Carp;
13  use lib './lib';  use lib './lib';
14  use WebPAC;  use WebPAC;
15  use WebPAC::jsFind;  use WebPAC::jsFind;
16    use WebPAC::Index;
17    
18  my $webpac = new WebPAC(  my $webpac = new WebPAC(
19          code_page => 'ISO-8859-2',          code_page => 'ISO-8859-2',
# Line 24  my $log = $webpac->_get_logger(); Line 25  my $log = $webpac->_get_logger();
25    
26  my $index = new WebPAC::jsFind(  my $index = new WebPAC::jsFind(
27          index_path => './out/index',          index_path => './out/index',
28            keys => 80,
29  ) || die;  ) || die;
30    
31    my $thes;
32    
33  $|=1;  $|=1;
34    
35  my $maxmfn = $webpac->open_isis(  my $maxmfn = $webpac->open_isis(
# Line 62  while (my $rec = $webpac->fetch_rec) { Line 66  while (my $rec = $webpac->fetch_rec) {
66                  print OUT $webpac->output(                  print OUT $webpac->output(
67                          template => 'html.tt',                          template => 'html.tt',
68                          data => \@ds,                          data => \@ds,
69                            headline => $webpac->{'headline'},
70                  );                  );
71                  close(OUT);                  close(OUT);
72          } else {          } else {
73                  print $webpac->output(                  print $webpac->output(
74                          template => 'text.tt',                          template => 'text.tt',
75                          data => \@ds,                          data => \@ds,
76                            headline => $webpac->{'headline'},
77                  );                  );
78          }          }
79    
80          my $headline;          my $headline = $webpac->{'headline'};
         foreach my $ds (@ds) {  
                 if ($ds->{'tag'} eq 'headline') {  
                         $headline = join(" ",@{$ds->{'display'}});  
                         last;  
                 }  
         }  
81    
82          my $f = $filename;          my $f = $filename;
83          $f =~ s!out/!!;          $f =~ s!out/!!;
# Line 94  while (my $rec = $webpac->fetch_rec) { Line 94  while (my $rec = $webpac->fetch_rec) {
94                  );                  );
95          }          }
96    
97            # save into sorted index (thesaurus)
98            foreach my $ds (@ds) {
99                    next if (! $ds->{'index'});
100    
101                    $thes->{$ds->{'tag'}} ||= new WebPAC::Index;
102    
103                    $thes->{$ds->{'tag'}}->insert(
104                            path => $f,
105                            headline => $headline,
106                    );
107            }
108    
109  #       print Dumper(\@ds);  #       print Dumper(\@ds);
110    
111  }  }
# Line 101  while (my $rec = $webpac->fetch_rec) { Line 113  while (my $rec = $webpac->fetch_rec) {
113  if ($log->is_debug) {  if ($log->is_debug) {
114          $log->debug("lookup hash: ",Dumper($webpac->{'lookup'}));          $log->debug("lookup hash: ",Dumper($webpac->{'lookup'}));
115          $log->debug("data hash: ",Dumper($webpac->{'data'}));          $log->debug("data hash: ",Dumper($webpac->{'data'}));
116            foreach my $t (keys %{$thes}) {
117                    $log->debug("thesaurus $t hash: ",Dumper($thes->{$t}));
118            }
119  }  }
120    
121  $index->close;  $index->close;

Legend:
Removed from v.392  
changed lines
  Added in v.410

  ViewVC Help
Powered by ViewVC 1.1.26