blib/lib/Unicode/Collate/CJK/Zhuyin.pm

filter: Statementstmt 100% 21 / 21 Branchbran 80.0% 8 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 91.6% 33 / 36 CC 2 SCAR 3.4
CC
2
Cov
94%
weightZhuyin
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« blib/lib/Unicode/Collate/CJK/Stroke.pm ↑ Summary blib/lib/Unicode/Collate/CJK/Korean.pm »
1 package Unicode::Collate::CJK::Zhuyin;
2  
3 4 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 our $VERSION = '1.31';
8  
9 4 my %u2p;
10 4 my $wt = 0x8000;
11  
12 4 ▶while (<DATA>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline DATA)) 12408 0 12408
13 12408 ▶ last if /^__END__/;
Branch: 1 branch
BranchTrueFalseTotal
if /^__END__/ 4 12404 12408
14 12404 my @c = split;
15 12404 for my $c (@c) {
16 88640 ▶ next if !$c;
Branch: 1 branch
BranchTrueFalseTotal
unless $c 0 88640 88640
17 88640 ▶ $u2p{hex($c)} = $wt if $c !~ /-/;
Branch: 1 branch
BranchTrueFalseTotal
unless $c =~ /-/ 88496 144 88640
18 88640 $wt++;
19 }
20 }
21  
22 2017 ▶sub weightZhuyin {
Subroutine weightZhuyin: called CC=2 SCAR=6.9
Pod undocumented
23 2017 my $u = shift;
24 2017 ▶ return exists $u2p{$u} ? $u2p{$u} : undef;
Branch: 1 branch
BranchTrueFalseTotal
exists $u2p{$u} ? : 1840 177 2017
25 }
26  
27 4 1;
28 __DATA__
« blib/lib/Unicode/Collate/CJK/Stroke.pm ↑ Summary blib/lib/Unicode/Collate/CJK/Korean.pm »