From: Dobrica Pavlinusic Date: Sun, 14 Mar 2004 12:06:51 +0000 (+0000) Subject: ported 269:272 from hidra X-Git-Url: http://git.rot13.org/?p=webpac;a=commitdiff_plain;h=7d813c3a0f82855731b0cdbe6f5960ed06862afe;ds=sidebyside ported 269:272 from hidra git-svn-id: file:///home/dpavlin/private/svn/webpac/trunk@275 13eb9ef6-21d5-0310-b721-a9d68796d827 --- diff --git a/INSTALL b/INSTALL index 973f7b5..89cedd5 100644 --- a/INSTALL +++ b/INSTALL @@ -148,6 +148,11 @@ don't work for you. Since you need development tools on target machine to compile OpenIsis, you might want to compile it on another machine and just copy perl module. -4. edit global.conf and all2xml.conf to suit your needs. Comments inside +4. Edit global.conf and all2xml.conf to suit your needs. Comments inside those files should help get you started. +5. All perl code will use locale to do sorting. That also include indexes + which, while being RDBMS-based, also use perl sorting (because each + entry has ordinal number created by perl). So, be sure that LC_COLLATE + environment variable is configured for your locale (which also has to + be enabled, check dpkg-reconfigure locales if you are using Debian). diff --git a/test_parse_format.pl b/test_parse_format.pl new file mode 100755 index 0000000..579ad9f --- /dev/null +++ b/test_parse_format.pl @@ -0,0 +1,34 @@ +#!/usr/bin/perl -w + +use strict; +use OpenIsis; +use parse_format; +use Text::Iconv; +use Data::Dumper; + +Text::Iconv->raise_error(1); # Conversion errors raise exceptions +my $codepage = Text::Iconv->new('852','iso-8859-2'); + +my $row = { + '981' => [ '^aSlu§bena dokumentacija RH' ], + '225' => [ '^aSjednice Sabora' ], + '712' => [ '^3011492^aHrvatski sabor' ], + '710' => [ '^3011801^aHrvatska narodna banka' ], + '210' => [ '^aZagreb^cHrvatski sabor^d2000' ], + '102' => [ '^aHR' ], + '607' => [ '^3025257^aHrvatska' ], + '606' => [ '^3000916^abankarski sustav', '^3001926^adevizne priŸuve' ], + '990' => [ '^aH10.0=Sabor.sjd-M:004317' ], + '200' => [ '^aIzvjeç†e o stanju financijskog i bankarskog sustava Republike Hrvatske u 1990. godini s osvrtom na devizne priŸuve NBJ, dug SFRJ i "staru" deviznu çtednju^f[Hrvatska narodna banka]' ], + '900' => [ '004317' ], + 'mfn' => 1, + '101' => [ '^ahrv' ], + '300' => [ '^aIzvjeç†e podneseno na 8. sjednici ZastupniŸkog doma Hrvatskog dr§avnog sabora' ] +}; + +my $fmt = 'eval{"225a" eq "pero"}900 101a'; +$fmt = 'eval{v102^a eq "HR" && v607^3 == "025257"}900 101a'; + +my ($d,$s) = parse_format('isis', $fmt ,$row, 0, $codepage); + +print "d: $d s: $s\n";