/[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 389 by dpavlin, Tue Jul 20 17:15:48 2004 UTC revision 392 by dpavlin, Wed Jul 21 16:58:27 2004 UTC
# Line 12  use Carp; Line 12  use Carp;
12    
13  use lib './lib';  use lib './lib';
14  use WebPAC;  use WebPAC;
15    use WebPAC::jsFind;
16    
17  my $webpac = new WebPAC(  my $webpac = new WebPAC(
18          code_page => 'ISO-8859-2',          code_page => 'ISO-8859-2',
# Line 22  my $webpac = new WebPAC( Line 22  my $webpac = new WebPAC(
22    
23  my $log = $webpac->_get_logger();  my $log = $webpac->_get_logger();
24    
25    my $index = new WebPAC::jsFind(
26            index_path => './out/index',
27    ) || die;
28    
29  $|=1;  $|=1;
30    
31  my $maxmfn = $webpac->open_isis(  my $maxmfn = $webpac->open_isis(
# Line 67  while (my $rec = $webpac->fetch_rec) { Line 71  while (my $rec = $webpac->fetch_rec) {
71                  );                  );
72          }          }
73    
74            my $headline;
75            foreach my $ds (@ds) {
76                    if ($ds->{'tag'} eq 'headline') {
77                            $headline = join(" ",@{$ds->{'display'}});
78                            last;
79                    }
80            }
81    
82            my $f = $filename;
83            $f =~ s!out/!!;
84    
85            # save into index
86            foreach my $ds (@ds) {
87                    next if (! $ds->{'swish'});
88    
89                    $index->insert(
90                            index_name => $ds->{'tag'},
91                            path => $f,
92                            headline => $headline,
93                            words => join(" ",@{$ds->{'swish'}})
94                    );
95            }
96    
97    #       print Dumper(\@ds);
98    
99  }  }
100    
101  if ($log->is_debug) {  if ($log->is_debug) {
102          $log->debug("lookup hash: ",Dumper($webpac->{'lookup'}));          $log->debug("lookup hash: ",Dumper($webpac->{'lookup'}));
103          $log->debug("data hash: ",Dumper($webpac->{'data'}));          $log->debug("data hash: ",Dumper($webpac->{'data'}));
104  }  }
105    
106    $index->close;
107    

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

  ViewVC Help
Powered by ViewVC 1.1.26