/[webpac2]/trunk/lib/WebPAC/Input/ISI.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Input/ISI.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 900 by dpavlin, Wed Oct 10 19:46:58 2007 UTC revision 901 by dpavlin, Wed Oct 10 20:05:45 2007 UTC
# Line 12  WebPAC::Input::ISI - support for ISI Exp Line 12  WebPAC::Input::ISI - support for ISI Exp
12    
13  =head1 VERSION  =head1 VERSION
14    
15  Version 0.00  Version 0.01
16    
17  =cut  =cut
18    
19  our $VERSION = '0.00';  our $VERSION = '0.01';
20    
21    
22  =head1 SYNOPSIS  =head1 SYNOPSIS
# Line 54  path to ISI export file Line 54  path to ISI export file
54    
55  =cut  =cut
56    
57    my $subfields = {
58            'CR' => sub {
59                    my @v = split(/, /, shift);
60                    my $f;
61                    foreach ( qw/author year reference volume page/ ) {
62                            if ( my $tmp = shift @v ) {
63                                    $f->{$_} = $tmp;
64                            }
65                    }
66                    if ( $f->{author} =~ /^\*(.+)/ ) {
67                            delete $f->{author};
68                            $f->{institution} = $1;
69                    }
70                    return $f;
71            },
72    };
73    
74  sub new {  sub new {
75          my $class = shift;          my $class = shift;
76          my $self = {@_};          my $self = {@_};
# Line 99  sub new { Line 116  sub new {
116                  } elsif ( $line =~ /^\s{3}(.+)$/ ) {                  } elsif ( $line =~ /^\s{3}(.+)$/ ) {
117                                  $v = $1;                                  $v = $1;
118                  } elsif ( $line eq 'ER' ) {                  } elsif ( $line eq 'ER' ) {
119                            # join tags
120                            foreach ( qw/AB/ ) {
121                                    $rec->{$_} = join(' ', @{ $rec->{$_} }) if defined $rec->{$_};
122                            }
123                          push @{ $self->{_rec} }, $rec;                          push @{ $self->{_rec} }, $rec;
124                          $rec = {};                          $rec = {};
125                          $line = <$fh>;                          $line = <$fh>;
# Line 110  sub new { Line 131  sub new {
131                          $log->logdie("can't parse +$. $arg->{path} : $line");                          $log->logdie("can't parse +$. $arg->{path} : $line");
132                  }                  }
133    
134                    $v = $subfields->{$tag}->($v) if defined $subfields->{$tag};
135    
136                  push @{ $rec->{$tag} }, $v;                  push @{ $rec->{$tag} }, $v;
137    
138          }          }
# Line 152  sub size { Line 175  sub size {
175  =head1 SEE ALSO  =head1 SEE ALSO
176    
177  L<http://isibasic.com/help/helpprn.html> is only sane source of document format which Google could find...  L<http://isibasic.com/help/helpprn.html> is only sane source of document format which Google could find...
178    
179  =head1 AUTHOR  =head1 AUTHOR
180    
181  Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >>  Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >>

Legend:
Removed from v.900  
changed lines
  Added in v.901

  ViewVC Help
Powered by ViewVC 1.1.26