line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::JA::Regular::Unicode; |
2
|
10
|
|
|
10
|
|
178619
|
use strict; |
|
10
|
|
|
|
|
16
|
|
|
10
|
|
|
|
|
358
|
|
3
|
10
|
|
|
10
|
|
41
|
use warnings; |
|
10
|
|
|
|
|
29
|
|
|
10
|
|
|
|
|
277
|
|
4
|
10
|
|
|
10
|
|
701
|
use utf8; |
|
10
|
|
|
|
|
33
|
|
|
10
|
|
|
|
|
46
|
|
5
|
10
|
|
|
10
|
|
437
|
use 5.008001; # dankogai-san says "tr/// on 5.8.0 is buggy!" |
|
10
|
|
|
|
|
28
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.13'; |
7
|
10
|
|
|
10
|
|
47
|
use Exporter 'import'; |
|
10
|
|
|
|
|
23
|
|
|
10
|
|
|
|
|
5596
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @EXPORT = qw/ hiragana2katakana alnum_z2h alnum_h2z space_z2h katakana2hiragana katakana_h2z katakana_z2h space_h2z/; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# regexp is generated by tools/createmap.pl |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my %katakana_h2z_map = ( |
14
|
|
|
|
|
|
|
"\x{FF8E}\x{FF9F}" => "\x{30DD}", |
15
|
|
|
|
|
|
|
"\x{FF7E}\x{FF9E}" => "\x{30BC}", |
16
|
|
|
|
|
|
|
"\x{FF73}\x{FF9E}" => "\x{30F4}", |
17
|
|
|
|
|
|
|
"\x{FF8B}\x{FF9F}" => "\x{30D4}", |
18
|
|
|
|
|
|
|
"\x{FF8E}\x{FF9E}" => "\x{30DC}", |
19
|
|
|
|
|
|
|
"\x{FF78}\x{FF9E}" => "\x{30B0}", |
20
|
|
|
|
|
|
|
"\x{FF8D}\x{FF9F}" => "\x{30DA}", |
21
|
|
|
|
|
|
|
"\x{FF8B}\x{FF9E}" => "\x{30D3}", |
22
|
|
|
|
|
|
|
"\x{FF8A}\x{FF9F}" => "\x{30D1}", |
23
|
|
|
|
|
|
|
"\x{FF8C}\x{FF9E}" => "\x{30D6}", |
24
|
|
|
|
|
|
|
"\x{FF8D}\x{FF9E}" => "\x{30D9}", |
25
|
|
|
|
|
|
|
"\x{FF82}\x{FF9E}" => "\x{30C5}", |
26
|
|
|
|
|
|
|
"\x{FF7A}\x{FF9E}" => "\x{30B4}", |
27
|
|
|
|
|
|
|
"\x{FF77}\x{FF9E}" => "\x{30AE}", |
28
|
|
|
|
|
|
|
"\x{FF7C}\x{FF9E}" => "\x{30B8}", |
29
|
|
|
|
|
|
|
"\x{FF7B}\x{FF9E}" => "\x{30B6}", |
30
|
|
|
|
|
|
|
"\x{FF83}\x{FF9E}" => "\x{30C7}", |
31
|
|
|
|
|
|
|
"\x{FF84}\x{FF9E}" => "\x{30C9}", |
32
|
|
|
|
|
|
|
"\x{FF8A}\x{FF9E}" => "\x{30D0}", |
33
|
|
|
|
|
|
|
"\x{FF80}\x{FF9E}" => "\x{30C0}", |
34
|
|
|
|
|
|
|
"\x{FF8C}\x{FF9F}" => "\x{30D7}", |
35
|
|
|
|
|
|
|
"\x{FF76}\x{FF9E}" => "\x{30AC}", |
36
|
|
|
|
|
|
|
"\x{FF81}\x{FF9E}" => "\x{30C2}", |
37
|
|
|
|
|
|
|
"\x{FF7D}\x{FF9E}" => "\x{30BA}", |
38
|
|
|
|
|
|
|
"\x{FF7F}\x{FF9E}" => "\x{30BE}", |
39
|
|
|
|
|
|
|
"\x{FF79}\x{FF9E}" => "\x{30B2}" |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my %katakana_z2h_map = ( |
43
|
|
|
|
|
|
|
"\x{30B6}" => "\x{FF7B}\x{FF9E}", |
44
|
|
|
|
|
|
|
"\x{30D1}" => "\x{FF8A}\x{FF9F}", |
45
|
|
|
|
|
|
|
"\x{30C7}" => "\x{FF83}\x{FF9E}", |
46
|
|
|
|
|
|
|
"\x{30D4}" => "\x{FF8B}\x{FF9F}", |
47
|
|
|
|
|
|
|
"\x{30BE}" => "\x{FF7F}\x{FF9E}", |
48
|
|
|
|
|
|
|
"\x{30BC}" => "\x{FF7E}\x{FF9E}", |
49
|
|
|
|
|
|
|
"\x{30AE}" => "\x{FF77}\x{FF9E}", |
50
|
|
|
|
|
|
|
"\x{30D6}" => "\x{FF8C}\x{FF9E}", |
51
|
|
|
|
|
|
|
"\x{30C0}" => "\x{FF80}\x{FF9E}", |
52
|
|
|
|
|
|
|
"\x{30DA}" => "\x{FF8D}\x{FF9F}", |
53
|
|
|
|
|
|
|
"\x{30D0}" => "\x{FF8A}\x{FF9E}", |
54
|
|
|
|
|
|
|
"\x{30D3}" => "\x{FF8B}\x{FF9E}", |
55
|
|
|
|
|
|
|
"\x{30C5}" => "\x{FF82}\x{FF9E}", |
56
|
|
|
|
|
|
|
"\x{30F4}" => "\x{FF73}\x{FF9E}", |
57
|
|
|
|
|
|
|
"\x{30B0}" => "\x{FF78}\x{FF9E}", |
58
|
|
|
|
|
|
|
"\x{30B8}" => "\x{FF7C}\x{FF9E}", |
59
|
|
|
|
|
|
|
"\x{30B4}" => "\x{FF7A}\x{FF9E}", |
60
|
|
|
|
|
|
|
"\x{30D7}" => "\x{FF8C}\x{FF9F}", |
61
|
|
|
|
|
|
|
"\x{30D9}" => "\x{FF8D}\x{FF9E}", |
62
|
|
|
|
|
|
|
"\x{30C2}" => "\x{FF81}\x{FF9E}", |
63
|
|
|
|
|
|
|
"\x{30BA}" => "\x{FF7D}\x{FF9E}", |
64
|
|
|
|
|
|
|
"\x{30DD}" => "\x{FF8E}\x{FF9F}", |
65
|
|
|
|
|
|
|
"\x{30DC}" => "\x{FF8E}\x{FF9E}", |
66
|
|
|
|
|
|
|
"\x{30B2}" => "\x{FF79}\x{FF9E}", |
67
|
|
|
|
|
|
|
"\x{30AC}" => "\x{FF76}\x{FF9E}", |
68
|
|
|
|
|
|
|
"\x{30C9}" => "\x{FF84}\x{FF9E}" |
69
|
|
|
|
|
|
|
); |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub alnum_z2h { |
72
|
2
|
|
|
2
|
1
|
1983
|
local $_ = shift; |
73
|
2
|
100
|
|
|
|
11
|
return undef unless defined($_); |
74
|
10
|
|
|
10
|
|
53
|
tr/\x{FF07}\x{FF3B}\x{FF56}\x{FF4F}\x{FF0C}\x{FF5E}\x{FF14}\x{FF43}\x{FF19}\x{FF26}\x{FF55}\x{FF3F}\x{FF2D}\x{FF27}\x{FF34}\x{FF37}\x{FF30}\x{FF51}\x{FFE3}\x{FF60}\x{FF36}\x{FF49}\x{FF29}\x{FF52}\x{FF1A}\x{FF3A}\x{FF38}\x{FF3D}\x{FF4C}\x{FF1E}\x{FF5D}\x{FFE6}\x{FF01}\x{FF5C}\x{FF58}\x{FF16}\x{FF05}\x{FF54}\x{FF3E}\x{FF18}\x{FF45}\x{FF24}\x{FF2B}\x{FF15}\x{FF4A}\x{FF0D}\x{FFE0}\x{FF48}\x{FF11}\x{FF5B}\x{FF35}\x{FF12}\x{FF2E}\x{FF28}\x{FF06}\x{FF10}\x{FF03}\x{FF2F}\x{FF4E}\x{FFE2}\x{FF20}\x{FF5F}\x{FF46}\x{FF13}\x{FF31}\x{FF41}\x{FF50}\x{FF2A}\x{FFE5}\x{FF1F}\x{FF21}\x{FF57}\x{FF3C}\x{FF04}\x{FF02}\x{FF22}\x{FF4D}\x{FF23}\x{FF17}\x{FF1B}\x{FFE4}\x{FF1D}\x{FF59}\x{FF0B}\x{FF47}\x{FF39}\x{FF32}\x{FF42}\x{FF2C}\x{FF4B}\x{FF09}\x{FF33}\x{FF40}\x{FF25}\x{FF08}\x{FFE1}\x{FF0A}\x{FF0E}\x{FF5A}\x{FF53}\x{FF0F}\x{FF1C}\x{FF44}\x{2019}\x{201d}/\x{0027}\x{005B}\x{0076}\x{006F}\x{002C}\x{007E}\x{0034}\x{0063}\x{0039}\x{0046}\x{0075}\x{005F}\x{004D}\x{0047}\x{0054}\x{0057}\x{0050}\x{0071}\x{00AF}\x{2986}\x{0056}\x{0069}\x{0049}\x{0072}\x{003A}\x{005A}\x{0058}\x{005D}\x{006C}\x{003E}\x{007D}\x{20A9}\x{0021}\x{007C}\x{0078}\x{0036}\x{0025}\x{0074}\x{005E}\x{0038}\x{0065}\x{0044}\x{004B}\x{0035}\x{006A}\x{002D}\x{00A2}\x{0068}\x{0031}\x{007B}\x{0055}\x{0032}\x{004E}\x{0048}\x{0026}\x{0030}\x{0023}\x{004F}\x{006E}\x{00AC}\x{0040}\x{2985}\x{0066}\x{0033}\x{0051}\x{0061}\x{0070}\x{004A}\x{00A5}\x{003F}\x{0041}\x{0077}\x{005C}\x{0024}\x{0022}\x{0042}\x{006D}\x{0043}\x{0037}\x{003B}\x{00A6}\x{003D}\x{0079}\x{002B}\x{0067}\x{0059}\x{0052}\x{0062}\x{004C}\x{006B}\x{0029}\x{0053}\x{0060}\x{0045}\x{0028}\x{00A3}\x{002A}\x{002E}\x{007A}\x{0073}\x{002F}\x{003C}\x{0064}\x{0027}\x{0022}/; |
|
10
|
|
|
|
|
16
|
|
|
10
|
|
|
|
|
172
|
|
|
1
|
|
|
|
|
80
|
|
75
|
1
|
|
|
|
|
9
|
$_; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub alnum_h2z { |
79
|
2
|
|
|
2
|
1
|
1621
|
local $_ = shift; |
80
|
2
|
100
|
|
|
|
15
|
return undef unless defined($_); |
81
|
1
|
|
|
|
|
83
|
tr/\x{0027}\x{005B}\x{0076}\x{006F}\x{002C}\x{007E}\x{0034}\x{0063}\x{0039}\x{0046}\x{0075}\x{005F}\x{004D}\x{0047}\x{0054}\x{0057}\x{0050}\x{0071}\x{00AF}\x{2986}\x{0056}\x{0069}\x{0049}\x{0072}\x{003A}\x{005A}\x{0058}\x{005D}\x{006C}\x{003E}\x{007D}\x{20A9}\x{0021}\x{007C}\x{0078}\x{0036}\x{0025}\x{0074}\x{005E}\x{0038}\x{0065}\x{0044}\x{004B}\x{0035}\x{006A}\x{002D}\x{00A2}\x{0068}\x{0031}\x{007B}\x{0055}\x{0032}\x{004E}\x{0048}\x{0026}\x{0030}\x{0023}\x{004F}\x{006E}\x{00AC}\x{0040}\x{2985}\x{0066}\x{0033}\x{0051}\x{0061}\x{0070}\x{004A}\x{00A5}\x{003F}\x{0041}\x{0077}\x{005C}\x{0024}\x{0022}\x{0042}\x{006D}\x{0043}\x{0037}\x{003B}\x{00A6}\x{003D}\x{0079}\x{002B}\x{0067}\x{0059}\x{0052}\x{0062}\x{004C}\x{006B}\x{0029}\x{0053}\x{0060}\x{0045}\x{0028}\x{00A3}\x{002A}\x{002E}\x{007A}\x{0073}\x{002F}\x{003C}\x{0064}/\x{FF07}\x{FF3B}\x{FF56}\x{FF4F}\x{FF0C}\x{FF5E}\x{FF14}\x{FF43}\x{FF19}\x{FF26}\x{FF55}\x{FF3F}\x{FF2D}\x{FF27}\x{FF34}\x{FF37}\x{FF30}\x{FF51}\x{FFE3}\x{FF60}\x{FF36}\x{FF49}\x{FF29}\x{FF52}\x{FF1A}\x{FF3A}\x{FF38}\x{FF3D}\x{FF4C}\x{FF1E}\x{FF5D}\x{FFE6}\x{FF01}\x{FF5C}\x{FF58}\x{FF16}\x{FF05}\x{FF54}\x{FF3E}\x{FF18}\x{FF45}\x{FF24}\x{FF2B}\x{FF15}\x{FF4A}\x{FF0D}\x{FFE0}\x{FF48}\x{FF11}\x{FF5B}\x{FF35}\x{FF12}\x{FF2E}\x{FF28}\x{FF06}\x{FF10}\x{FF03}\x{FF2F}\x{FF4E}\x{FFE2}\x{FF20}\x{FF5F}\x{FF46}\x{FF13}\x{FF31}\x{FF41}\x{FF50}\x{FF2A}\x{FFE5}\x{FF1F}\x{FF21}\x{FF57}\x{FF3C}\x{FF04}\x{FF02}\x{FF22}\x{FF4D}\x{FF23}\x{FF17}\x{FF1B}\x{FFE4}\x{FF1D}\x{FF59}\x{FF0B}\x{FF47}\x{FF39}\x{FF32}\x{FF42}\x{FF2C}\x{FF4B}\x{FF09}\x{FF33}\x{FF40}\x{FF25}\x{FF08}\x{FFE1}\x{FF0A}\x{FF0E}\x{FF5A}\x{FF53}\x{FF0F}\x{FF1C}\x{FF44}/; |
82
|
1
|
|
|
|
|
15
|
$_; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub hiragana2katakana { |
86
|
2
|
|
|
2
|
1
|
1208
|
local $_ = shift; |
87
|
2
|
100
|
|
|
|
16
|
return undef unless defined($_); |
88
|
1
|
|
|
|
|
78
|
tr/\x{3077}\x{3094}\x{306B}\x{3080}\x{3066}\x{3044}\x{3067}\x{3079}\x{309E}\x{3090}\x{3075}\x{3068}\x{304A}\x{308A}\x{3052}\x{305D}\x{3065}\x{3088}\x{306F}\x{3064}\x{3056}\x{3057}\x{3083}\x{306E}\x{3063}\x{306D}\x{3072}\x{3043}\x{305F}\x{3087}\x{3051}\x{307E}\x{308C}\x{3073}\x{3084}\x{304C}\x{307D}\x{306C}\x{307A}\x{304F}\x{305E}\x{3071}\x{3054}\x{3092}\x{3078}\x{305A}\x{304B}\x{3074}\x{3085}\x{308E}\x{3042}\x{304D}\x{3096}\x{3047}\x{3069}\x{3060}\x{308D}\x{3082}\x{3048}\x{308F}\x{3093}\x{3076}\x{305C}\x{3081}\x{306A}\x{3061}\x{3070}\x{3062}\x{308B}\x{3059}\x{3041}\x{3095}\x{307C}\x{3089}\x{3049}\x{309D}\x{3050}\x{307B}\x{3055}\x{3091}\x{304E}\x{307F}\x{305B}\x{3058}\x{3053}\x{3045}\x{3086}\x{3046}/\x{30D7}\x{30F4}\x{30CB}\x{30E0}\x{30C6}\x{30A4}\x{30C7}\x{30D9}\x{30FE}\x{30F0}\x{30D5}\x{30C8}\x{30AA}\x{30EA}\x{30B2}\x{30BD}\x{30C5}\x{30E8}\x{30CF}\x{30C4}\x{30B6}\x{30B7}\x{30E3}\x{30CE}\x{30C3}\x{30CD}\x{30D2}\x{30A3}\x{30BF}\x{30E7}\x{30B1}\x{30DE}\x{30EC}\x{30D3}\x{30E4}\x{30AC}\x{30DD}\x{30CC}\x{30DA}\x{30AF}\x{30BE}\x{30D1}\x{30B4}\x{30F2}\x{30D8}\x{30BA}\x{30AB}\x{30D4}\x{30E5}\x{30EE}\x{30A2}\x{30AD}\x{30F6}\x{30A7}\x{30C9}\x{30C0}\x{30ED}\x{30E2}\x{30A8}\x{30EF}\x{30F3}\x{30D6}\x{30BC}\x{30E1}\x{30CA}\x{30C1}\x{30D0}\x{30C2}\x{30EB}\x{30B9}\x{30A1}\x{30F5}\x{30DC}\x{30E9}\x{30A9}\x{30FD}\x{30B0}\x{30DB}\x{30B5}\x{30F1}\x{30AE}\x{30DF}\x{30BB}\x{30B8}\x{30B3}\x{30A5}\x{30E6}\x{30A6}/; |
89
|
1
|
|
|
|
|
8
|
$_; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub katakana2hiragana { |
93
|
2
|
|
|
2
|
1
|
1447
|
local $_ = shift; |
94
|
2
|
100
|
|
|
|
12
|
return undef unless defined $_; |
95
|
1
|
|
|
|
|
117
|
tr/\x{FF98}\x{30DC}\x{30BA}\x{30B7}\x{FF77}\x{FF6D}\x{FF99}\x{FF88}\x{30B0}\x{30CD}\x{30AD}\x{FF6A}\x{30F1}\x{30C6}\x{FF78}\x{30CB}\x{FF84}\x{FF9B}\x{30C9}\x{30A7}\x{30B3}\x{30FD}\x{FF81}\x{30AC}\x{FF8D}\x{30C8}\x{FF69}\x{30C0}\x{30E4}\x{30EC}\x{FF86}\x{30C1}\x{30BD}\x{30CE}\x{FF7F}\x{FF7B}\x{30D1}\x{30E8}\x{FF67}\x{FF89}\x{FF8A}\x{30B4}\x{30B2}\x{FF6B}\x{30EE}\x{30E2}\x{30F0}\x{30EB}\x{30F2}\x{30E0}\x{FF71}\x{FF83}\x{30BC}\x{30DD}\x{30D5}\x{30CF}\x{30E3}\x{30B5}\x{30C3}\x{30E9}\x{FF8F}\x{30A2}\x{30A3}\x{30E7}\x{FF73}\x{FF75}\x{30AA}\x{30AF}\x{30E1}\x{FF95}\x{30A5}\x{30C2}\x{30AE}\x{FF92}\x{30A6}\x{FF85}\x{30B9}\x{FF7D}\x{FF97}\x{FF7E}\x{30B6}\x{30D6}\x{FF8C}\x{30D8}\x{FF7A}\x{FF76}\x{30DA}\x{30AB}\x{FF72}\x{30FE}\x{30A8}\x{FF9C}\x{30F4}\x{30F3}\x{FF80}\x{FF6C}\x{FF8E}\x{FF6E}\x{FF96}\x{30C4}\x{30BE}\x{30D0}\x{30D7}\x{FF93}\x{30BB}\x{FF91}\x{FF79}\x{30EA}\x{30C7}\x{FF90}\x{30DF}\x{30DB}\x{30B1}\x{30A4}\x{30D2}\x{FF6F}\x{30E6}\x{FF82}\x{30DE}\x{30F5}\x{30BF}\x{FF9A}\x{30D4}\x{30B8}\x{FF7C}\x{FF87}\x{30D3}\x{30C5}\x{30CC}\x{FF68}\x{FF9D}\x{FF74}\x{30A1}\x{30A9}\x{30F6}\x{30CA}\x{FF66}\x{30E5}\x{FF94}\x{30ED}\x{FF8B}\x{30D9}\x{30EF}/\x{308A}\x{307C}\x{305A}\x{3057}\x{304D}\x{3085}\x{308B}\x{306D}\x{3050}\x{306D}\x{304D}\x{3047}\x{3091}\x{3066}\x{304F}\x{306B}\x{3068}\x{308D}\x{3069}\x{3047}\x{3053}\x{309D}\x{3061}\x{304C}\x{3078}\x{3068}\x{3045}\x{3060}\x{3084}\x{308C}\x{306B}\x{3061}\x{305D}\x{306E}\x{305D}\x{3055}\x{3071}\x{3088}\x{3041}\x{306E}\x{306F}\x{3054}\x{3052}\x{3049}\x{308E}\x{3082}\x{3090}\x{308B}\x{3092}\x{3080}\x{3042}\x{3066}\x{305C}\x{307D}\x{3075}\x{306F}\x{3083}\x{3055}\x{3063}\x{3089}\x{307E}\x{3042}\x{3043}\x{3087}\x{3046}\x{304A}\x{304A}\x{304F}\x{3081}\x{3086}\x{3045}\x{3062}\x{304E}\x{3081}\x{3046}\x{306A}\x{3059}\x{3059}\x{3089}\x{305B}\x{3056}\x{3076}\x{3075}\x{3078}\x{3053}\x{304B}\x{307A}\x{304B}\x{3044}\x{309E}\x{3048}\x{308F}\x{3094}\x{3093}\x{305F}\x{3083}\x{307B}\x{3087}\x{3088}\x{3064}\x{305E}\x{3070}\x{3077}\x{3082}\x{305B}\x{3080}\x{3051}\x{308A}\x{3067}\x{307F}\x{307F}\x{307B}\x{3051}\x{3044}\x{3072}\x{3063}\x{3086}\x{3064}\x{307E}\x{3095}\x{305F}\x{308C}\x{3074}\x{3058}\x{3057}\x{306C}\x{3073}\x{3065}\x{306C}\x{3043}\x{3093}\x{3048}\x{3041}\x{3049}\x{3096}\x{306A}\x{3092}\x{3085}\x{3084}\x{308D}\x{3072}\x{3079}\x{308F}/; |
96
|
1
|
|
|
|
|
12
|
$_; |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub space_z2h { |
100
|
2
|
|
|
2
|
1
|
1595
|
local $_ = shift; |
101
|
2
|
100
|
|
|
|
11
|
return undef unless defined $_; |
102
|
1
|
|
|
|
|
14
|
tr/\x{3000}/\x{0020}/; # convert \N{IDEOGRAPHIC SPACE} to \N{SPACE} |
103
|
1
|
|
|
|
|
10
|
$_; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub space_h2z { |
107
|
2
|
|
|
2
|
1
|
1608
|
local $_ = shift; |
108
|
2
|
100
|
|
|
|
11
|
return undef unless defined $_; |
109
|
1
|
|
|
|
|
12
|
tr/\x{0020}/\x{3000}/; # convert \N{SPACE} to \N{IDEOGRAPHIC SPACE} |
110
|
1
|
|
|
|
|
11
|
$_; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub katakana_h2z { |
114
|
5
|
|
|
5
|
1
|
3032
|
local $_ = shift; |
115
|
5
|
100
|
|
|
|
18
|
return undef unless defined($_); |
116
|
|
|
|
|
|
|
# dakuten |
117
|
4
|
|
|
|
|
26
|
s/(\x{FF7E}\x{FF9E}|\x{FF84}\x{FF9E}|\x{FF80}\x{FF9E}|\x{FF76}\x{FF9E}|\x{FF8B}\x{FF9E}|\x{FF7D}\x{FF9E}|\x{FF8B}\x{FF9F}|\x{FF73}\x{FF9E}|\x{FF79}\x{FF9E}|\x{FF7B}\x{FF9E}|\x{FF8D}\x{FF9F}|\x{FF8A}\x{FF9F}|\x{FF8A}\x{FF9E}|\x{FF83}\x{FF9E}|\x{FF7A}\x{FF9E}|\x{FF8C}\x{FF9F}|\x{FF8D}\x{FF9E}|\x{FF82}\x{FF9E}|\x{FF8E}\x{FF9F}|\x{FF8C}\x{FF9E}|\x{FF77}\x{FF9E}|\x{FF81}\x{FF9E}|\x{FF7C}\x{FF9E}|\x{FF78}\x{FF9E}|\x{FF8E}\x{FF9E}|\x{FF7F}\x{FF9E})/$katakana_h2z_map{$1}/ge; |
|
1
|
|
|
|
|
14
|
|
118
|
|
|
|
|
|
|
# normal |
119
|
4
|
|
|
|
|
75
|
tr/\x{FF6C}\x{FF97}\x{FF7E}\x{FF8F}\x{FF83}\x{FF6A}\x{FF8E}\x{FF8B}\x{FF61}\x{FF67}\x{FF7C}\x{FF88}\x{FF80}\x{FF8C}\x{FF77}\x{FF93}\x{FF92}\x{FF9B}\x{FF86}\x{FF95}\x{FF69}\x{FF87}\x{FF6E}\x{FF94}\x{FF7A}\x{FF68}\x{FF8D}\x{FF6F}\x{FF9C}\x{FF72}\x{FF79}\x{FF85}\x{FF64}\x{FF62}\x{FF9A}\x{FF74}\x{FF9F}\x{FF71}\x{FF7F}\x{FF82}\x{FF9E}\x{FF66}\x{FF70}\x{FF9D}\x{FF73}\x{FF7D}\x{FF98}\x{FF76}\x{FF63}\x{FF91}\x{FF6B}\x{FF99}\x{FF6D}\x{FF96}\x{FF8A}\x{FF89}\x{FF78}\x{FF65}\x{FF75}\x{FF7B}\x{FF84}\x{FF90}\x{FF81}/\x{30E3}\x{30E9}\x{30BB}\x{30DE}\x{30C6}\x{30A7}\x{30DB}\x{30D2}\x{3002}\x{30A1}\x{30B7}\x{30CD}\x{30BF}\x{30D5}\x{30AD}\x{30E2}\x{30E1}\x{30ED}\x{30CB}\x{30E6}\x{30A5}\x{30CC}\x{30E7}\x{30E4}\x{30B3}\x{30A3}\x{30D8}\x{30C3}\x{30EF}\x{30A4}\x{30B1}\x{30CA}\x{3001}\x{300C}\x{30EC}\x{30A8}\x{309C}\x{30A2}\x{30BD}\x{30C4}\x{309B}\x{30F2}\x{30FC}\x{30F3}\x{30A6}\x{30B9}\x{30EA}\x{30AB}\x{300D}\x{30E0}\x{30A9}\x{30EB}\x{30E5}\x{30E8}\x{30CF}\x{30CE}\x{30AF}\x{30FB}\x{30AA}\x{30B5}\x{30C8}\x{30DF}\x{30C1}/; |
120
|
4
|
|
|
|
|
22
|
$_; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
sub katakana_z2h { |
124
|
3
|
|
|
3
|
1
|
2642
|
local $_ = shift; |
125
|
3
|
100
|
|
|
|
14
|
return undef unless defined($_); |
126
|
|
|
|
|
|
|
# dakuten |
127
|
2
|
|
|
|
|
16
|
s/([\x{30BC}\x{30C9}\x{30C0}\x{30AC}\x{30D3}\x{30BA}\x{30D4}\x{30F4}\x{30B2}\x{30B6}\x{30DA}\x{30D1}\x{30D0}\x{30C7}\x{30B4}\x{30D7}\x{30D9}\x{30C5}\x{30DD}\x{30D6}\x{30AE}\x{30C2}\x{30B8}\x{30B0}\x{30DC}\x{30BE}])/$katakana_z2h_map{$1}/ge; |
|
1
|
|
|
|
|
6
|
|
128
|
|
|
|
|
|
|
# normal |
129
|
2
|
|
|
|
|
71
|
tr/\x{30E3}\x{30E9}\x{30BB}\x{30DE}\x{30C6}\x{30A7}\x{30DB}\x{30D2}\x{3002}\x{30A1}\x{30B7}\x{30CD}\x{30BF}\x{30D5}\x{30AD}\x{30E2}\x{30E1}\x{30ED}\x{30CB}\x{30E6}\x{30A5}\x{30CC}\x{30E7}\x{30E4}\x{30B3}\x{30A3}\x{30D8}\x{30C3}\x{30EF}\x{30A4}\x{30B1}\x{30CA}\x{3001}\x{300C}\x{30EC}\x{30A8}\x{309C}\x{30A2}\x{30BD}\x{30C4}\x{309B}\x{30F2}\x{30FC}\x{30F3}\x{30A6}\x{30B9}\x{30EA}\x{30AB}\x{300D}\x{30E0}\x{30A9}\x{30EB}\x{30E5}\x{30E8}\x{30CF}\x{30CE}\x{30AF}\x{30FB}\x{30AA}\x{30B5}\x{30C8}\x{30DF}\x{30C1}/\x{FF6C}\x{FF97}\x{FF7E}\x{FF8F}\x{FF83}\x{FF6A}\x{FF8E}\x{FF8B}\x{FF61}\x{FF67}\x{FF7C}\x{FF88}\x{FF80}\x{FF8C}\x{FF77}\x{FF93}\x{FF92}\x{FF9B}\x{FF86}\x{FF95}\x{FF69}\x{FF87}\x{FF6E}\x{FF94}\x{FF7A}\x{FF68}\x{FF8D}\x{FF6F}\x{FF9C}\x{FF72}\x{FF79}\x{FF85}\x{FF64}\x{FF62}\x{FF9A}\x{FF74}\x{FF9F}\x{FF71}\x{FF7F}\x{FF82}\x{FF9E}\x{FF66}\x{FF70}\x{FF9D}\x{FF73}\x{FF7D}\x{FF98}\x{FF76}\x{FF63}\x{FF91}\x{FF6B}\x{FF99}\x{FF6D}\x{FF96}\x{FF8A}\x{FF89}\x{FF78}\x{FF65}\x{FF75}\x{FF7B}\x{FF84}\x{FF90}\x{FF81}/; |
130
|
2
|
|
|
|
|
26
|
$_; |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
1; |
134
|
|
|
|
|
|
|
__END__ |