blib/lib/Unicode/Collate/CJK/JISX0208.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 10 | 10 | 100.0 |
branch | 2 | 2 | 100.0 |
condition | n/a | ||
subroutine | 4 | 4 | 100.0 |
pod | 0 | 1 | 0.0 |
total | 16 | 17 | 94.1 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Unicode::Collate::CJK::JISX0208; | ||||||
2 | |||||||
3 | 5 | 5 | 1006 | use 5.006; | |||
5 | 23 | ||||||
4 | 5 | 5 | 34 | use strict; | |||
5 | 20 | ||||||
5 | 150 | ||||||
5 | 5 | 5 | 27 | use warnings; | |||
5 | 11 | ||||||
5 | 1259 | ||||||
6 | |||||||
7 | our $VERSION = '1.30'; | ||||||
8 | |||||||
9 | my %u2p; | ||||||
10 | my $wt = 0x8000; | ||||||
11 | |||||||
12 | while () { | ||||||
13 | last if /^__END__/; | ||||||
14 | my @c = split; | ||||||
15 | for my $c (@c) { | ||||||
16 | next if !$c; | ||||||
17 | $u2p{hex($c)} = $wt; | ||||||
18 | $wt++; | ||||||
19 | } | ||||||
20 | } | ||||||
21 | |||||||
22 | sub weightJISX0208 { | ||||||
23 | 1092 | 1092 | 0 | 1764 | my $u = shift; | ||
24 | 1092 | 100 | 4422 | return exists $u2p{$u} ? $u2p{$u} : undef; | |||
25 | } | ||||||
26 | |||||||
27 | 1; | ||||||
28 | __DATA__ |