line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Biblio::Citation::Parser; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
###################################################################### |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# Biblio::Citation::Parser; |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
###################################################################### |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# This file was originally part of ParaCite Tools, based at |
10
|
|
|
|
|
|
|
# http://paracite.eprints.org/developers/ |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# Copyright (c) 2004 University of Southampton, UK. SO17 1BJ. |
14
|
|
|
|
|
|
|
# |
15
|
|
|
|
|
|
|
# ParaTools is free software; you can redistribute it and/or modify |
16
|
|
|
|
|
|
|
# it under the terms of the GNU General Public License as published by |
17
|
|
|
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or |
18
|
|
|
|
|
|
|
# (at your option) any later version. |
19
|
|
|
|
|
|
|
# |
20
|
|
|
|
|
|
|
# ParaTools is distributed in the hope that it will be useful, |
21
|
|
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
22
|
|
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
23
|
|
|
|
|
|
|
# GNU General Public License for more details. |
24
|
|
|
|
|
|
|
# |
25
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License |
26
|
|
|
|
|
|
|
# along with ParaTools; if not, write to the Free Software |
27
|
|
|
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
28
|
|
|
|
|
|
|
# |
29
|
|
|
|
|
|
|
###################################################################### |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
1
|
|
947
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
32
|
1
|
|
|
1
|
|
5
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
191
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
require Exporter; |
35
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
36
|
|
|
|
|
|
|
our @EXPORT_OK = ( 'parse', 'new' ); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
$VERSION = "1.10"; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=pod |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 NAME |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
B - citation parsing framework |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 DESCRIPTION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Biblio::Citation::Parser provides generic methods for reference parsers. This |
49
|
|
|
|
|
|
|
class should not be used directly, but rather be overridden by specific |
50
|
|
|
|
|
|
|
parsers. Parsers that extend the Parser class must provide at least |
51
|
|
|
|
|
|
|
the two methods defined here to ensure compatibility. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 METHODS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=over 4 |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=item $cite_parser = Biblio::Citation::Parser-Enew() |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
The new() method creates a new parser instance. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=cut |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub new |
64
|
|
|
|
|
|
|
{ |
65
|
0
|
|
|
0
|
1
|
|
my($class) = @_; |
66
|
0
|
|
|
|
|
|
my $self = {}; |
67
|
0
|
|
|
|
|
|
return bless($self, $class); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=pod |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=item $metadata = $parser-Eparse($reference) |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
The parse() method takes a reference and returns the extracted metadata. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub parse |
79
|
|
|
|
|
|
|
{ |
80
|
0
|
|
|
0
|
1
|
|
my($self, $ref) = @_; |
81
|
0
|
|
|
|
|
|
die "This method should be overridden.\n"; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
__END__ |