/[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

Annotation of /trunk2/all2all.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 362 - (hide annotations)
Wed Jun 16 16:50:30 2004 UTC (15 years, 1 month ago) by dpavlin
File MIME type: text/plain
File size: 1730 byte(s)
fetch_rec method

1 dpavlin 1 #!/usr/bin/perl -w
2    
3 dpavlin 348 =head1 NAME
4    
5 dpavlin 354 all2all.pl - basic script for all WebPAC needs
6 dpavlin 348
7     =cut
8    
9 dpavlin 1 use strict;
10     use Data::Dumper;
11 dpavlin 352 use Carp;
12 dpavlin 1
13 dpavlin 352 use lib './lib';
14 dpavlin 354 use WebPAC;
15 dpavlin 348
16 dpavlin 354 my $webpac = new WebPAC(
17 dpavlin 352 code_page => 'ISO-8859-2',
18 dpavlin 357 limit_mfn => 500,
19 dpavlin 352 ) || die;
20    
21 dpavlin 10 $|=1;
22 dpavlin 9
23 dpavlin 352 print "reading database\n";
24     my $maxmfn = $webpac->open_isis(
25 dpavlin 357 filename => shift @ARGV || '/data/hidra/THS/THS',
26 dpavlin 352 lookup => [
27 dpavlin 348 { 'key' => 'd:v900', 'val' => 'v250^a' },
28 dpavlin 352 # { 'eval' => '"v901^a" eq "Podruèje"', 'key' => 'pa:v561^4:v562^4:v461^1', 'val' => 'v900' },
29     # { 'eval '=> '"v901^a" eq "Mikrotezaurus"', 'key' => 'a:v561^4:v562^4:v461^1', 'val' => 'v900' },
30     # { 'eval' => '"v901^a" eq "Deskriptor"', 'key' => 'a:v561^4:v562^4:v461^1', 'val' => 'v900' },
31     { 'key' => 'a:v561^4:v562^4:v461^1', 'val' => 'v900' },
32     ],
33 dpavlin 54 );
34 dpavlin 3
35 dpavlin 352 print "rows: $maxmfn\n\n";
36 dpavlin 170
37 dpavlin 362 while (my $rec = $webpac->fetch_rec) {
38 dpavlin 358
39 dpavlin 359 print "-- ",$webpac->parse($rec,'v250^a / [v562^4] v562^a'),"\n";
40 dpavlin 153
41 dpavlin 359 print " ",
42     $webpac->parse($rec,'eval{v901^a eq "Deskriptor"}v250^a / [v562^4] v562^a'),
43     $webpac->parse($rec,'eval{v901^a ne "Deskriptor"}250a [251]'),
44     "\n";
45    
46 dpavlin 352 my @t = $webpac->fill_in($rec,'v553^1;;v553^a');
47     print " U¾i pojam: ",join("\t\n",@t),"\n" if (@t);
48 dpavlin 9
49 dpavlin 359 @t = $webpac->fill_in($rec,'eval{v901^a eq "Podruèje"}[a:v251::];;[d:[a:v251::]]');
50 dpavlin 352 print " Podruèje: ",join("\t\n",@t),"\n" if (@t);
51 dpavlin 13
52 dpavlin 359 @t = $webpac->fill_in($rec,'eval{v901^a eq "Mikrotezaurus"}[a:v561^4:v251:];;[d:[a:v561^4:v251:]]');
53 dpavlin 352 print " Mikrotezaurus: ",join("\t\n",@t),"\n" if (@t);
54 dpavlin 349
55 dpavlin 359 @t = $webpac->fill_in($rec,'eval{v901^a eq "Deskriptor"}[a:v561^4:v562^4:v900];;[d:[a:v561^4:v562^4:v900]]');
56 dpavlin 352 print " Deskriptor: ",join("\t\n",@t),"\n" if (@t);
57 dpavlin 3 }
58    
59 dpavlin 352 print "## lookup ",Dumper($webpac->{'lookup'});
60     print "## data ",Dumper($webpac->{'data'});

Properties

Name Value
cvs2svn:cvs-rev 1.64
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26