/[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 352 by dpavlin, Tue Jun 15 22:40:07 2004 UTC revision 363 by dpavlin, Wed Jun 16 20:05:19 2004 UTC
# Line 2  Line 2 
2    
3  =head1 NAME  =head1 NAME
4    
5  all2all.pl - basic script for all WebPac needs  all2all.pl - basic script for all WebPAC needs
6    
7  =cut  =cut
8    
9  use strict;  use strict;
 use OpenIsis;  
 use Text::Iconv;  
10  use Data::Dumper;  use Data::Dumper;
11  use Carp;  use Carp;
12    
13  use lib './lib';  use lib './lib';
14  use WebPac;  use WebPAC;
15    
16  my $webpac = new WebPac(  my $webpac = new WebPAC(
17          code_page => 'ISO-8859-2',          code_page => 'ISO-8859-2',
18            limit_mfn => 500,
19            debug => 1,
20  ) || die;  ) || die;
21    
22  $|=1;  $|=1;
23    
 print "reading database\n";  
24  my $maxmfn = $webpac->open_isis(  my $maxmfn = $webpac->open_isis(
25          filename => shift @ARGV || '/data/hidra/THS-500/THS',          filename => shift @ARGV || '/data/hidra/THS/THS',
26          lookup => [          lookup => [
27          { 'key' => 'd:v900', 'val' => 'v250^a' },          { 'key' => 'd:v900', 'val' => 'v250^a' },
28  #       { 'eval' => '"v901^a" eq "Područje"', 'key' => 'pa:v561^4:v562^4:v461^1', 'val' => 'v900' },  #       { 'eval' => '"v901^a" eq "Područje"', 'key' => 'pa:v561^4:v562^4:v461^1', 'val' => 'v900' },
# Line 35  my $maxmfn = $webpac->open_isis( Line 34  my $maxmfn = $webpac->open_isis(
34    
35  print "rows: $maxmfn\n\n";  print "rows: $maxmfn\n\n";
36    
37  for (my $mfn = 1; $mfn <= $maxmfn; $mfn++) {  $webpac->open_import_xml(type => 'isis_hidra_ths');
         my $rec = $webpac->{'data'}->{$mfn} || die "no record with mfn $mfn";  
38    
39          print "-- ",$webpac->fill_in($rec,'v250^a (v901^a)'),"\n";  while (my $rec = $webpac->fetch_rec) {
40    
41            print "-- ",$webpac->parse($rec,'v250^a / [v562^4] v562^a'),"\n";
42    
43            print " ",
44                    $webpac->parse($rec,'eval{v901^a eq "Deskriptor"}v250^a / [v562^4] v562^a'),
45                    $webpac->parse($rec,'eval{v901^a ne "Deskriptor"}250a [251]'),
46                    "\n";
47    
48          my @t = $webpac->fill_in($rec,'v553^1;;v553^a');          my @t = $webpac->fill_in($rec,'v553^1;;v553^a');
49          print " Uži pojam: ",join("\t\n",@t),"\n" if (@t);          print " Uži pojam: ",join("\t\n",@t),"\n" if (@t);
50    
51          @t = $webpac->fill_in($rec,'[a:v251::];;[d:[a:v251::]]');          @t = $webpac->fill_in($rec,'eval{v901^a eq "Područje"}[a:v251::];;[d:[a:v251::]]');
         @t = map { $webpac->lookup($_) => $_ } @t;  
52          print " Područje: ",join("\t\n",@t),"\n" if (@t);          print " Područje: ",join("\t\n",@t),"\n" if (@t);
53    
54          @t = $webpac->fill_in($rec,'[a:v561^4:v251:];;[d:[a:v561^4:v251:]]');          @t = $webpac->fill_in($rec,'eval{v901^a eq "Mikrotezaurus"}[a:v561^4:v251:];;[d:[a:v561^4:v251:]]');
55          print " Mikrotezaurus: ",join("\t\n",@t),"\n" if (@t);          print " Mikrotezaurus: ",join("\t\n",@t),"\n" if (@t);
56    
57          @t = $webpac->fill_in($rec,'[a:v561^4:v562^4:v900];;[d:[a:v561^4:v562^4:v900]]');          @t = $webpac->fill_in($rec,'eval{v901^a eq "Deskriptor"}[a:v561^4:v562^4:v900];;[d:[a:v561^4:v562^4:v900]]');
58          print " Deskriptor: ",join("\t\n",@t),"\n" if (@t);          print " Deskriptor: ",join("\t\n",@t),"\n" if (@t);
59  }  }
60    

Legend:
Removed from v.352  
changed lines
  Added in v.363

  ViewVC Help
Powered by ViewVC 1.1.26