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

Contents of /trunk2/all2all.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 352 - (show annotations)
Tue Jun 15 22:40:07 2004 UTC (19 years, 9 months ago) by dpavlin
File MIME type: text/plain
File size: 1610 byte(s)
Object-orineted design re-implementation: simple field substitution and
lookups are working well.
Added some documentation about new features.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26