line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geo::Direction::Name::Spec::Chinese; |
2
|
|
|
|
|
|
|
|
3
|
11
|
|
|
11
|
|
256648
|
use strict; |
|
11
|
|
|
|
|
28
|
|
|
11
|
|
|
|
|
414
|
|
4
|
11
|
|
|
11
|
|
60
|
use warnings; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
274
|
|
5
|
11
|
|
|
11
|
|
58
|
use Carp; |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
909
|
|
6
|
11
|
|
|
11
|
|
818
|
use version; our $VERSION = qv('0.0.1'); |
|
11
|
|
|
|
|
2130
|
|
|
11
|
|
|
|
|
93
|
|
7
|
11
|
|
|
11
|
|
7671
|
use Geo::Direction::Name::Spec::Dizhi; |
|
11
|
|
|
|
|
31
|
|
|
11
|
|
|
|
|
179
|
|
8
|
11
|
|
|
11
|
|
7383
|
use Geo::Direction::Name::Spec::Bagua; |
|
11
|
|
|
|
|
28
|
|
|
11
|
|
|
|
|
98
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
BEGIN |
11
|
|
|
|
|
|
|
{ |
12
|
11
|
50
|
|
11
|
|
690
|
if ( $] >= 5.006 ) |
13
|
|
|
|
|
|
|
{ |
14
|
11
|
|
|
|
|
59
|
require utf8; import utf8; |
|
11
|
|
|
|
|
40
|
|
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
750
|
|
|
750
|
1
|
1892
|
sub allowed_dev { qw(8 12 24) } |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
0
|
1
|
0
|
sub default_dev { 8 } |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
23
|
515
|
|
|
515
|
1
|
850676
|
my $class = shift; |
24
|
|
|
|
|
|
|
|
25
|
515
|
|
|
|
|
1761
|
my $self = bless { }, $class; |
26
|
|
|
|
|
|
|
|
27
|
515
|
|
|
|
|
1145
|
foreach my $spec (qw(dizhi bagua)) { |
28
|
1030
|
|
|
|
|
5167
|
my $sclass = "Geo::Direction::Name::Spec::" .ucfirst("$spec"); |
29
|
1030
|
|
|
|
|
3421
|
$self->{"spec_$spec"} = $sclass->new; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
515
|
|
|
|
|
9396
|
$self; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub locale { |
36
|
515
|
|
|
515
|
1
|
11052
|
my $self = shift; |
37
|
|
|
|
|
|
|
|
38
|
515
|
|
|
|
|
903
|
my @locales; |
39
|
|
|
|
|
|
|
|
40
|
515
|
|
|
|
|
900
|
foreach my $spec (qw(dizhi bagua)) { |
41
|
1030
|
|
|
|
|
339395
|
my $spec_o = $self->{"spec_$spec"}; |
42
|
1030
|
|
|
|
|
3392
|
push ( @locales, $spec_o->locale(@_) ); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
515
|
|
|
|
|
34823
|
\@locales; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub to_string { |
49
|
750
|
|
|
750
|
1
|
306353
|
my $self = shift; |
50
|
750
|
|
50
|
|
|
2278
|
my $option = $_[1] || {}; |
51
|
750
|
|
33
|
|
|
2298
|
my $devide = $option->{devide} || $self->default_dev; |
52
|
|
|
|
|
|
|
|
53
|
750
|
50
|
|
|
|
1762
|
croak ("Devide parameter must be ". join( ",", $self->allowed_dev ) ) unless ( grep { $devide == $_ } $self->allowed_dev ); |
|
2250
|
|
|
|
|
7026
|
|
54
|
|
|
|
|
|
|
|
55
|
750
|
100
|
|
|
|
2178
|
my $spec_o = $devide == 8 ? $self->{'spec_bagua'} : $self->{'spec_dizhi'}; |
56
|
|
|
|
|
|
|
|
57
|
750
|
|
|
|
|
2580
|
$spec_o->to_string(@_); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub from_string { |
61
|
140
|
|
|
140
|
1
|
2707
|
my $self = shift; |
62
|
|
|
|
|
|
|
|
63
|
140
|
|
|
|
|
532
|
my $dizhi = $self->{'spec_dizhi'}->from_string(@_); |
64
|
140
|
100
|
|
|
|
5743
|
defined($dizhi) ? $dizhi : $self->{'spec_bagua'}->from_string(@_); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
__END__ |