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

filter: Statementstmt 100% 21 / 21 Branchbran 75.0% 6 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 91.1% 31 / 34 CC 2 SCAR 3.4
CC
2
Cov
93%
weightGB2312
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« blib/lib/Unicode/Collate/CJK/Big5.pm ↑ Summary blib/lib/Unicode/Collate/CJK/JISX0208.pm »
1 package Unicode::Collate::CJK::GB2312;
2  
3 3 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = '1.31';
8  
9 3 my %u2p;
10 3 my $wt = 0x8000;
11  
12 3 ▶while (<DATA>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline DATA)) 2034 0 2034
13 2034 ▶ last if /^__END__/;
Branch: 1 branch
BranchTrueFalseTotal
if /^__END__/ 3 2031 2034
14 2031 my @c = split;
15 2031 for my $c (@c) {
16 20304 ▶ next if !$c;
Branch: 1 branch
BranchTrueFalseTotal
unless $c 0 20304 20304
17 20304 $u2p{hex($c)} = $wt;
18 20304 $wt++;
19 }
20 }
21  
22 1103 ▶sub weightGB2312 {
Subroutine weightGB2312: called CC=2 SCAR=6.9
Pod undocumented
23 1103 my $u = shift;
24 1103 ▶ return exists $u2p{$u} ? $u2p{$u} : undef;
Branch: 1 branch
BranchTrueFalseTotal
exists $u2p{$u} ? : 500 603 1103
25 }
26  
27 3 1;
28 __DATA__
« blib/lib/Unicode/Collate/CJK/Big5.pm ↑ Summary blib/lib/Unicode/Collate/CJK/JISX0208.pm »