ported 269:272 from hidra
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 14 Mar 2004 12:06:51 +0000 (12:06 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 14 Mar 2004 12:06:51 +0000 (12:06 +0000)
git-svn-id: file:///home/dpavlin/private/svn/webpac/trunk@275 13eb9ef6-21d5-0310-b721-a9d68796d827

INSTALL
test_parse_format.pl [new file with mode: 0755]

diff --git a/INSTALL b/INSTALL
index 973f7b5..89cedd5 100644 (file)
--- 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.
 
    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.
 
    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 (executable)
index 0000000..579ad9f
--- /dev/null
@@ -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\9fuve' ],
+          '990' => [ '^aH10.0=Sabor.sjd-M:004317' ],
+          '200' => [ '^aIzvjeç\86e o stanju financijskog i bankarskog sustava Republike Hrvatske u 1990. godini s osvrtom na devizne pri\9fuve NBJ, dug SFRJ i "staru" deviznu çtednju^f[Hrvatska narodna banka]' ],
+          '900' => [ '004317' ],
+          'mfn' => 1,
+         '101' => [ '^ahrv' ],
+          '300' => [ '^aIzvjeç\86e podneseno na 8. sjednici Zastupni\9fkog 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";