line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::ZH::CCDICT::Romanization; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use Params::Validate qw( validate SCALAR BOOLEAN ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
176
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use overload |
9
|
128140
|
|
|
128140
|
|
305434
|
( '""' => sub { $_[0]->syllable() }, |
10
|
256280
|
|
|
256280
|
|
617611
|
'bool' => sub { 1 }, |
11
|
|
|
|
|
|
|
'cmp' => sub { return |
12
|
4
|
100
|
|
4
|
|
768
|
( $_[2] ? |
13
|
|
|
|
|
|
|
( $_[1] cmp $_[0]->syllable() ) : |
14
|
|
|
|
|
|
|
( $_[0]->syllable() cmp $_[1] ) |
15
|
|
|
|
|
|
|
); }, |
16
|
1
|
|
|
1
|
|
1784
|
); |
|
1
|
|
|
|
|
1553
|
|
|
1
|
|
|
|
|
11
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new |
20
|
|
|
|
|
|
|
{ |
21
|
128262
|
|
|
128262
|
0
|
181245
|
my $class = shift; |
22
|
|
|
|
|
|
|
|
23
|
128262
|
|
|
|
|
8807000
|
my %p = validate( @_, |
24
|
|
|
|
|
|
|
{ syllable => { type => SCALAR }, |
25
|
|
|
|
|
|
|
obsolete => { type => BOOLEAN }, |
26
|
|
|
|
|
|
|
}, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
128262
|
100
|
|
|
|
1034210
|
unless ( $p{syllable} =~ /^[a-z1-9']+$/ ) |
30
|
|
|
|
|
|
|
{ |
31
|
3
|
50
|
|
|
|
16
|
warn "Bad romanization: $p{syllable}\n" if $ENV{DEBUG_CCDICT_SOURCE}; |
32
|
3
|
|
|
|
|
19
|
return; |
33
|
|
|
|
|
|
|
} |
34
|
128259
|
50
|
|
|
|
334684
|
warn "FOUND\n" if $p{syllable} eq q{s'uk8}; |
35
|
128259
|
|
|
|
|
672148
|
return bless \%p, $class; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub syllable |
39
|
|
|
|
|
|
|
{ |
40
|
128146
|
|
|
128146
|
1
|
3096057
|
return $_[0]->{syllable}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub is_obsolete |
44
|
|
|
|
|
|
|
{ |
45
|
5
|
|
|
5
|
1
|
40
|
return $_[0]->{obsolete}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# deprecated |
49
|
|
|
|
|
|
|
sub obsolete |
50
|
|
|
|
|
|
|
{ |
51
|
0
|
|
|
0
|
0
|
|
return $_[0]->is_obsolete(); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |