line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Names::GB; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# our @ISA = ('Text::Names'); |
4
|
0
|
|
|
|
|
|
use Text::Names qw/ |
5
|
|
|
|
|
|
|
abbreviationOf |
6
|
|
|
|
|
|
|
reverseName |
7
|
|
|
|
|
|
|
cleanParseName |
8
|
|
|
|
|
|
|
parseName |
9
|
|
|
|
|
|
|
parseName2 |
10
|
|
|
|
|
|
|
normalizeNameWhitespace |
11
|
|
|
|
|
|
|
samePerson |
12
|
|
|
|
|
|
|
sameAuthors |
13
|
|
|
|
|
|
|
parseNames |
14
|
|
|
|
|
|
|
parseNameList |
15
|
|
|
|
|
|
|
cleanNames |
16
|
|
|
|
|
|
|
cleanName |
17
|
|
|
|
|
|
|
weakenings |
18
|
|
|
|
|
|
|
composeName |
19
|
|
|
|
|
|
|
abbreviationOf |
20
|
|
|
|
|
|
|
setNameAbbreviations |
21
|
|
|
|
|
|
|
getNameAbbreviations |
22
|
|
|
|
|
|
|
isCommonSurname |
23
|
|
|
|
|
|
|
isCommonFirstname |
24
|
|
|
|
|
|
|
guessGender |
25
|
|
|
|
|
|
|
firstnamePrevalence |
26
|
|
|
|
|
|
|
surnamePrevalence |
27
|
|
|
|
|
|
|
isMisparsed |
28
|
|
|
|
|
|
|
isLikelyMisparsed |
29
|
3
|
|
|
3
|
|
28910
|
/; |
|
0
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
require Exporter; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( |
36
|
|
|
|
|
|
|
@NAME_PREFIXES |
37
|
|
|
|
|
|
|
abbreviationOf |
38
|
|
|
|
|
|
|
reverseName |
39
|
|
|
|
|
|
|
cleanParseName |
40
|
|
|
|
|
|
|
parseName |
41
|
|
|
|
|
|
|
parseName2 |
42
|
|
|
|
|
|
|
normalizeNameWhitespace |
43
|
|
|
|
|
|
|
samePerson |
44
|
|
|
|
|
|
|
sameAuthors |
45
|
|
|
|
|
|
|
parseNames |
46
|
|
|
|
|
|
|
parseNameList |
47
|
|
|
|
|
|
|
cleanNames |
48
|
|
|
|
|
|
|
cleanName |
49
|
|
|
|
|
|
|
weakenings |
50
|
|
|
|
|
|
|
composeName |
51
|
|
|
|
|
|
|
abbreviationOf |
52
|
|
|
|
|
|
|
setNameAbbreviations |
53
|
|
|
|
|
|
|
getNameAbbreviations |
54
|
|
|
|
|
|
|
isCommonSurname |
55
|
|
|
|
|
|
|
isCommonFirstname |
56
|
|
|
|
|
|
|
guessGender |
57
|
|
|
|
|
|
|
firstnamePrevalence |
58
|
|
|
|
|
|
|
surnamePrevalence |
59
|
|
|
|
|
|
|
isMisparsed |
60
|
|
|
|
|
|
|
isLikelyMisparsed |
61
|
|
|
|
|
|
|
) ] ); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
our @EXPORT = (); |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 NAME |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Text::Names::GB - Perl extension for proper name parsing, normalization, recognition, and classification |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 VERSION |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Version 0.01 |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 SYNOPSIS |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
The documentation for Text::Names doesn't make this clear, that module is specific to the US. |
82
|
|
|
|
|
|
|
This module fixes that for the UK. |
83
|
|
|
|
|
|
|
Unfortunately because of the nature of Text::Names other countries will also have |
84
|
|
|
|
|
|
|
to be implemented as subclasses. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 guessGender |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Overrides the US data with UK data, that's probably true in most other countries as well. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub guessGender { |
95
|
|
|
|
|
|
|
my $name = uc(shift); |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
if($name eq 'BERTIE') { |
98
|
|
|
|
|
|
|
return 'M'; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
if($name eq 'BARRIE') { |
101
|
|
|
|
|
|
|
return 'M'; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
# return $self->SUPER::guessGender($name); |
104
|
|
|
|
|
|
|
return Text::Names::guessGender($name); |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 AUTHOR |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Nigel Horne, C<< >> |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 BUGS |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
I need to work out how to make ISA and Exporter play nicely with each other. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 SEE ALSO |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
L |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head1 SUPPORT |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
perldoc Text::Names::GB |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
You can also look for information at: |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=over 4 |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
L |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
L |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=item * CPAN Ratings |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
L |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=item * Search CPAN |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
L |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=back |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
Copyright 2017 Nigel Horne. |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
This program is released under the following licence: GPL |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=cut |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
1; |