line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Names::GB; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# our @ISA = ('Text::Names'); |
4
|
3
|
|
|
|
|
1252
|
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
|
|
19522
|
/; |
|
3
|
|
|
|
|
147206
|
|
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.02 |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
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 tests with UK tests, that's probably true in most other countries as well. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub guessGender { |
95
|
15
|
|
|
15
|
|
42451
|
my $name = uc(shift); |
96
|
|
|
|
|
|
|
|
97
|
15
|
100
|
|
|
|
52
|
if($name eq 'BERTIE') { |
98
|
1
|
|
|
|
|
11
|
return 'M'; |
99
|
|
|
|
|
|
|
} |
100
|
14
|
100
|
|
|
|
37
|
if($name eq 'BARRIE') { |
101
|
1
|
|
|
|
|
6
|
return 'M'; |
102
|
|
|
|
|
|
|
} |
103
|
13
|
100
|
|
|
|
35
|
if($name eq 'KAI') { |
104
|
1
|
|
|
|
|
4
|
return 'M'; |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
# return $self->SUPER::guessGender($name); |
107
|
12
|
|
|
|
|
48
|
return Text::Names::guessGender($name); |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 AUTHOR |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Nigel Horne, C<< >> |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 BUGS |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
I need to work out how to make ISA and Exporter play nicely with each other. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 SEE ALSO |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
L |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 SUPPORT |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
perldoc Text::Names::GB |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
You can also look for information at: |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=over 4 |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
L |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
L |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=item * CPAN Ratings |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
L |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=item * Search CPAN |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
L |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=back |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
Copyright 2017 Nigel Horne. |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
This program is released under the following licence: GPL |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=cut |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
1; |