/[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 358 by dpavlin, Wed Jun 16 14:31:33 2004 UTC revision 373 by dpavlin, Sun Jun 20 15:49:09 2004 UTC
# Line 13  use Carp; Line 13  use Carp;
13  use lib './lib';  use lib './lib';
14  use WebPAC;  use WebPAC;
15    
16    
17  my $webpac = new WebPAC(  my $webpac = new WebPAC(
18          code_page => 'ISO-8859-2',          code_page => 'ISO-8859-2',
19          limit_mfn => 500,          limit_mfn => 500,
20    #       debug => 1,
21  ) || die;  ) || die;
22    
23    my $log = $webpac->_get_logger();
24    
25  $|=1;  $|=1;
26    
 print "reading database\n";  
27  my $maxmfn = $webpac->open_isis(  my $maxmfn = $webpac->open_isis(
28          filename => shift @ARGV || '/data/hidra/THS/THS',          filename => shift @ARGV || '/data/hidra/THS/THS',
29          lookup => [          lookup => [
# Line 32  my $maxmfn = $webpac->open_isis( Line 35  my $maxmfn = $webpac->open_isis(
35          ],          ],
36  );  );
37    
38  print "rows: $maxmfn\n\n";  $log->info("rows: $maxmfn");
   
 my $rec = $webpac->{'data'}->{1};  
39    
40  print $webpac->parse($rec,'pero v250^a - v999 bla'),"\n";  $webpac->open_import_xml(type => 'isis_hidra_ths');
41    
42  __END__  while (my $rec = $webpac->fetch_rec) {
43    
44  for (my $mfn = 1; $mfn <= $maxmfn; $mfn++) {          my @ds = $webpac->data_structure($rec);
         my $rec = $webpac->{'data'}->{$mfn} || die "no record with mfn $mfn";  
45    
46          print "-- ",$webpac->fill_in($rec,'v250^a (v901^a)'),"\n";          if ($log->is_debug) {
47                    $log->debug("rec = ",Dumper($rec));
48                    $log->debug("ds = ",Dumper(\@ds));
49            }
50    
51          my @t = $webpac->fill_in($rec,'v553^1;;v553^a');          print $webpac->output(
52          print " Uži pojam: ",join("\t\n",@t),"\n" if (@t);                  template => 'text.tt',
53                    data => \@ds,
54            ) if (@ds);
55    
         @t = $webpac->fill_in($rec,'[a:v251::];;[d:[a:v251::]]');  
         print " Područje: ",join("\t\n",@t),"\n" if (@t);  
   
         @t = $webpac->fill_in($rec,'[a:v561^4:v251:];;[d:[a:v561^4:v251:]]');  
         print " Mikrotezaurus: ",join("\t\n",@t),"\n" if (@t);  
   
         @t = $webpac->fill_in($rec,'[a:v561^4:v562^4:v900];;[d:[a:v561^4:v562^4:v900]]');  
         print " Deskriptor: ",join("\t\n",@t),"\n" if (@t);  
56  }  }
57    
58  print "## lookup ",Dumper($webpac->{'lookup'});  if ($log->is_debug) {
59  print "## data ",Dumper($webpac->{'data'});          $log->debug("lookup hash: ",Dumper($webpac->{'lookup'}));
60            $log->debug("data hash: ",Dumper($webpac->{'data'}));
61    }

Legend:
Removed from v.358  
changed lines
  Added in v.373

  ViewVC Help
Powered by ViewVC 1.1.26