line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geo::Direction::Name::Locale; |
2
|
|
|
|
|
|
|
|
3
|
11
|
|
|
11
|
|
7793
|
use warnings; |
|
11
|
|
|
|
|
23
|
|
|
11
|
|
|
|
|
353
|
|
4
|
11
|
|
|
11
|
|
92
|
use strict; |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
300
|
|
5
|
11
|
|
|
11
|
|
54
|
use Carp; |
|
11
|
|
|
|
|
24
|
|
|
11
|
|
|
|
|
583
|
|
6
|
|
|
|
|
|
|
|
7
|
11
|
|
|
11
|
|
57
|
use version; our $VERSION = qv('0.0.4'); |
|
11
|
|
|
|
|
18
|
|
|
11
|
|
|
|
|
68
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
BEGIN |
10
|
|
|
|
|
|
|
{ |
11
|
11
|
50
|
|
11
|
|
1284
|
if ( $] >= 5.006 ) |
12
|
|
|
|
|
|
|
{ |
13
|
11
|
|
|
|
|
60
|
require utf8; import utf8; |
|
11
|
|
|
|
|
85
|
|
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
821
|
|
|
821
|
1
|
1398
|
my $class = shift; |
19
|
821
|
|
50
|
|
|
3104
|
my $dev = shift || 32; |
20
|
|
|
|
|
|
|
|
21
|
821
|
|
|
|
|
3040
|
my $dir = $class->dir_string(); |
22
|
821
|
|
|
|
|
2716
|
my $abbr = $class->abbr_string(); |
23
|
|
|
|
|
|
|
|
24
|
821
|
|
|
|
|
1603
|
my $dev1 = $dev - 1; |
25
|
821
|
|
|
|
|
1827
|
my %dirs = (); |
26
|
26272
|
|
|
8
|
|
92799
|
my @strs = map { |
|
8
|
|
|
|
|
40
|
|
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
103
|
|
27
|
821
|
|
|
|
|
3151
|
$dirs{lc($dir->[$_])} = $_; |
28
|
26272
|
|
|
|
|
352204
|
$dirs{lc($abbr->[$_])} = $_; |
29
|
26272
|
|
|
|
|
66643
|
[ $dir->[$_], $abbr->[$_],] |
30
|
|
|
|
|
|
|
} (0..$dev1); |
31
|
|
|
|
|
|
|
|
32
|
821
|
|
|
|
|
12062
|
bless { |
33
|
|
|
|
|
|
|
dirs => \%dirs, |
34
|
|
|
|
|
|
|
strs => \@strs, |
35
|
|
|
|
|
|
|
dev => $dev, |
36
|
|
|
|
|
|
|
}, $class; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub string { |
40
|
1320
|
|
|
1320
|
1
|
2159
|
my $self = shift; |
41
|
1320
|
|
|
|
|
2244
|
my ($i,$abbr) = @_; |
42
|
|
|
|
|
|
|
|
43
|
1320
|
|
|
|
|
7214
|
$self->{strs}->[$i]->[$abbr]; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub direction { |
47
|
193
|
|
|
193
|
1
|
271
|
my $self = shift; |
48
|
193
|
|
|
|
|
269
|
my ($str) = @_; |
49
|
|
|
|
|
|
|
|
50
|
193
|
|
|
|
|
685
|
my $i = $self->{dirs}->{lc($str)}; |
51
|
193
|
100
|
|
|
|
433
|
return unless (defined($i)); |
52
|
192
|
|
|
|
|
6891
|
return $i * 360.0 / $self->{dev}; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub dir_string { |
56
|
|
|
|
|
|
|
[ |
57
|
0
|
|
|
0
|
1
|
0
|
'0.00', |
58
|
|
|
|
|
|
|
'11.25', |
59
|
|
|
|
|
|
|
'22.50', |
60
|
|
|
|
|
|
|
'33.75', |
61
|
|
|
|
|
|
|
'45.00', |
62
|
|
|
|
|
|
|
'56.25', |
63
|
|
|
|
|
|
|
'67.50', |
64
|
|
|
|
|
|
|
'78.75', |
65
|
|
|
|
|
|
|
'90.00', |
66
|
|
|
|
|
|
|
'101.25', |
67
|
|
|
|
|
|
|
'112.50', |
68
|
|
|
|
|
|
|
'123.75', |
69
|
|
|
|
|
|
|
'135.00', |
70
|
|
|
|
|
|
|
'146.25', |
71
|
|
|
|
|
|
|
'157.50', |
72
|
|
|
|
|
|
|
'168.75', |
73
|
|
|
|
|
|
|
'180.00', |
74
|
|
|
|
|
|
|
'191.25', |
75
|
|
|
|
|
|
|
'202.50', |
76
|
|
|
|
|
|
|
'213.75', |
77
|
|
|
|
|
|
|
'225.00', |
78
|
|
|
|
|
|
|
'236.25', |
79
|
|
|
|
|
|
|
'247.50', |
80
|
|
|
|
|
|
|
'258.75', |
81
|
|
|
|
|
|
|
'270.00', |
82
|
|
|
|
|
|
|
'281.25', |
83
|
|
|
|
|
|
|
'292.50', |
84
|
|
|
|
|
|
|
'303.75', |
85
|
|
|
|
|
|
|
'315.00', |
86
|
|
|
|
|
|
|
'326.25', |
87
|
|
|
|
|
|
|
'337.50', |
88
|
|
|
|
|
|
|
'348.75', |
89
|
|
|
|
|
|
|
] |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub abbr_string { |
93
|
656
|
|
|
656
|
1
|
2287
|
$_[0]->dir_string(); |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
1; # Magic true value required at end of module |
97
|
|
|
|
|
|
|
__END__ |