line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::EnclosedChar; |
2
|
2
|
|
|
2
|
|
27983
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
64
|
|
3
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
55
|
|
4
|
2
|
|
|
2
|
|
443
|
use utf8; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
9
|
|
5
|
2
|
|
|
2
|
|
747
|
use parent qw/Exporter/; |
|
2
|
|
|
|
|
402
|
|
|
2
|
|
|
|
|
7
|
|
6
|
|
|
|
|
|
|
our @EXPORT_OK = qw/ |
7
|
|
|
|
|
|
|
enclose |
8
|
|
|
|
|
|
|
enclose_katakana |
9
|
|
|
|
|
|
|
enclose_week_ja |
10
|
|
|
|
|
|
|
enclose_kansuji |
11
|
|
|
|
|
|
|
enclose_kanji |
12
|
|
|
|
|
|
|
enclose_all |
13
|
|
|
|
|
|
|
/; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = '0.09'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my %MAP; |
18
|
|
|
|
|
|
|
{ |
19
|
|
|
|
|
|
|
my @double_digits = split('', '⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲' |
20
|
|
|
|
|
|
|
. '⑳㉑㉒㉓㉔㉕㉖㉗㉘㉙' |
21
|
|
|
|
|
|
|
. '㉚㉛㉜㉝㉞㉟㊱㊲㊳㊴' |
22
|
|
|
|
|
|
|
. '㊵㊶㊷㊸㊹㊺㊻㊼㊽㊾㊿'); |
23
|
|
|
|
|
|
|
for my $i (10..50) { |
24
|
|
|
|
|
|
|
$MAP{double_digits}->{$i} = shift @double_digits; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _tr_double_digits { |
29
|
19
|
|
|
19
|
|
15
|
for my $dg (keys %{$MAP{double_digits}}) { |
|
19
|
|
|
|
|
116
|
|
30
|
779
|
|
|
|
|
507
|
${$_[0]} =~ s!(^|[^\d])$dg([^\d]|$)!$1$MAP{double_digits}->{$dg}$2!g; |
|
779
|
|
|
|
|
9750
|
|
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _tr_numbers { |
35
|
2
|
|
|
2
|
|
381
|
${$_[0]} =~ tr/0123456789/⓪①②③④⑤⑥⑦⑧⑨/; |
|
2
|
|
|
19
|
|
6
|
|
|
2
|
|
|
|
|
18
|
|
|
19
|
|
|
|
|
8
|
|
|
19
|
|
|
|
|
126
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _tr_alphabet_uc { |
39
|
19
|
|
|
19
|
|
13
|
${$_[0]} =~ tr/ABCDEFGHIJKLMNOPQRSTUVWXYZ/ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ/; |
|
19
|
|
|
|
|
115
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub _tr_alphabet_lc { |
43
|
19
|
|
|
19
|
|
12
|
${$_[0]} =~ tr/abcdefghijklmnopqrstuvwxyz/ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩ/; |
|
19
|
|
|
|
|
111
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub _tr_symbols { |
47
|
19
|
|
|
19
|
|
13
|
${$_[0]} =~ tr/\-\=\+\*/⊖⊜⊕⊛/; |
|
19
|
|
|
|
|
68
|
|
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub _tr_katakana { |
51
|
2
|
|
|
2
|
|
2
|
${$_[0]} =~ tr/アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲ/㋐㋑㋒㋓㋔㋕㋖㋗㋘㋙㋚㋛㋜㋝㋞㋟㋠㋡㋢㋣㋤㋥㋦㋧㋨㋩㋪㋫㋬㋭㋮㋯㋰㋱㋲㋳㋴㋵㋶㋷㋸㋹㋺㋻㋼㋽㋾/; |
|
2
|
|
|
|
|
58
|
|
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub _tr_week_ja { |
55
|
2
|
|
|
2
|
|
2
|
${$_[0]} =~ tr/月火水木金土日/㊊㊋㊌㊍㊎㊏㊐/; |
|
2
|
|
|
|
|
27
|
|
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub _tr_kansuji { |
59
|
2
|
|
|
2
|
|
2
|
${$_[0]} =~ tr/一二三四五六七八九十/㊀㊁㊂㊃㊄㊅㊆㊇㊈㊉/; |
|
2
|
|
|
|
|
40
|
|
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub _tr_kanji { |
63
|
2
|
|
|
2
|
|
1
|
${$_[0]} =~ tr/株有社名特財祝労秘男女適優印注頂休写正上中下左右医宗学監企資協夜/㊑㊒㊓㊔㊕㊖㊗㊘㊙㊚㊛㊜㊝㊞㊟㊠㊡㊢㊣㊤㊥㊦㊧㊨㊩㊪㊫㊬㊭㊮㊯㊰/; |
|
2
|
|
|
|
|
72
|
|
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub enclose { |
67
|
21
|
|
|
21
|
1
|
26
|
my $string = shift; |
68
|
|
|
|
|
|
|
|
69
|
21
|
100
|
66
|
|
|
86
|
return '' if !defined($string) || $string eq ''; |
70
|
|
|
|
|
|
|
|
71
|
19
|
|
|
|
|
24
|
_tr_double_digits(\$string); |
72
|
19
|
|
|
|
|
59
|
_tr_numbers(\$string); |
73
|
19
|
|
|
|
|
26
|
_tr_alphabet_uc(\$string); |
74
|
19
|
|
|
|
|
34
|
_tr_alphabet_lc(\$string); |
75
|
19
|
|
|
|
|
24
|
_tr_symbols(\$string); |
76
|
|
|
|
|
|
|
|
77
|
19
|
|
|
|
|
47
|
return $string; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub enclose_katakana { |
81
|
2
|
|
|
2
|
1
|
3
|
my $string = shift; |
82
|
|
|
|
|
|
|
|
83
|
2
|
|
|
|
|
3
|
$string = enclose($string); |
84
|
2
|
|
|
|
|
13
|
_tr_katakana(\$string); |
85
|
|
|
|
|
|
|
|
86
|
2
|
|
|
|
|
5
|
return $string; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub enclose_week_ja { |
90
|
2
|
|
|
2
|
1
|
3
|
my $string = shift; |
91
|
|
|
|
|
|
|
|
92
|
2
|
|
|
|
|
3
|
$string = enclose($string); |
93
|
2
|
|
|
|
|
4
|
_tr_week_ja(\$string); |
94
|
|
|
|
|
|
|
|
95
|
2
|
|
|
|
|
3
|
return $string; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub enclose_kansuji { |
99
|
2
|
|
|
2
|
1
|
3
|
my $string = shift; |
100
|
|
|
|
|
|
|
|
101
|
2
|
|
|
|
|
4
|
$string = enclose($string); |
102
|
2
|
|
|
|
|
3
|
_tr_kansuji(\$string); |
103
|
|
|
|
|
|
|
|
104
|
2
|
|
|
|
|
4
|
return $string; |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub enclose_kanji { |
108
|
2
|
|
|
2
|
1
|
2
|
my $string = shift; |
109
|
|
|
|
|
|
|
|
110
|
2
|
|
|
|
|
4
|
$string = enclose($string); |
111
|
2
|
|
|
|
|
5
|
_tr_kanji(\$string); |
112
|
|
|
|
|
|
|
|
113
|
2
|
|
|
|
|
5
|
return $string; |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
sub enclose_all { |
117
|
1
|
|
|
1
|
1
|
2
|
my $string = shift; |
118
|
|
|
|
|
|
|
|
119
|
1
|
|
|
|
|
2
|
return enclose_katakana( |
120
|
|
|
|
|
|
|
enclose_week_ja( enclose_kansuji( enclose_kanji($string) ) ) |
121
|
|
|
|
|
|
|
); |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
1; |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
__END__ |