X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=Aleph.pm;h=448beaa19cdaf6e84d53a3551d05f2c01511ad7c;hb=a0d3a60cd95afff5241f8e2d3a2955ecdffd1395;hp=b8c01aaeeea97bafb10107003db471c1fe8b4b7b;hpb=a307b301154ff60c8d2c6dddd7d3c3c080d0202e;p=Biblio-Z3950.git diff --git a/Aleph.pm b/Aleph.pm index b8c01aa..448beaa 100644 --- a/Aleph.pm +++ b/Aleph.pm @@ -50,15 +50,15 @@ sub diag { # WYR - Godina izdavanja sub usemap {{ - 4 => 'WTI', - 7 => 'ISBN', - 8 => 'ISSN', - 1003 => 'AUT', - 16 => 'DDC', - 21 => 'SUB', - 12 => 'LCN', + 4 => 'WTI=', + 7 => 'ISBN=', + 8 => 'ISSN=', + 1003 => 'AUT=', + 16 => 'DDC=', + 21 => 'SUB=', + 12 => 'LCN=', # 1007 => '', - 1016 => 'WRD', + 1016 => 'WRD=', }}; our $session_id; @@ -103,10 +103,10 @@ diag "submit search [$query] on ", $self->{database}; ); my $hits = 0; - if ( $mech->content =~ m{ukupno\s+(\d+).*do\s+(\d+)}s ) { # FIXME Many results in Crotian + if ( $mech->content =~ m{ukupno\s+(\d+).*do\s+(\d+)} ) { # FIXME Many results in Crotian $hits = $1; $hits = $2 if $2 && $2 < $1; # correct for max. results - } elsif ( $mech->content =~ m{(\d+)\s+od\s+(\d+)}s ) { # FIXME single result in Croatian + } elsif ( $mech->content =~ m{(\d+)\s+od\s+(\d+)} ) { # FIXME single result in Croatian $hits = $2; } else { diag "get't find results in ", $mech->content; @@ -143,6 +143,7 @@ sub next_marc { warn "parse $nr"; $marc = MARC::Record->new; + $marc->encoding('utf-8'); $hash = {}; my $html = $mech->content; @@ -172,6 +173,8 @@ warn "## ++ ", dump( $f, $v ); my ($i1,$i2) = (' ',' '); ($i1,$i2) = ($2,$3) if $f =~ s/^(...)(.)?(.)?/$1/; + $i1 ||= ' '; + $i2 ||= ' '; my @sf = split(/\|/, $v); @sf = map { s/^(\w)\s+//; { $1 => $_ } } @sf; #warn "## sf = ", dump(@sf);