line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::AjiFry::EN; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
41975
|
use warnings; |
|
3
|
|
|
|
|
20
|
|
|
3
|
|
|
|
|
83
|
|
4
|
3
|
|
|
3
|
|
16
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
83
|
|
5
|
3
|
|
|
3
|
|
14
|
use utf8; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
17
|
|
6
|
3
|
|
|
3
|
|
56
|
use Encode; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
625
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
|
|
2311
|
use constant MAP => { |
9
|
|
|
|
|
|
|
a => '食え食え食え', |
10
|
|
|
|
|
|
|
b => '食えドボドボ', |
11
|
|
|
|
|
|
|
c => '食えお刺身', |
12
|
|
|
|
|
|
|
d => '食えむむ・・・', |
13
|
|
|
|
|
|
|
e => '食えアジフライ', |
14
|
|
|
|
|
|
|
f => 'フライ食え食え', |
15
|
|
|
|
|
|
|
g => 'フライドボドボ', |
16
|
|
|
|
|
|
|
h => 'フライお刺身', |
17
|
|
|
|
|
|
|
i => 'フライむむ・・・', |
18
|
|
|
|
|
|
|
j => 'フライアジフライ', |
19
|
|
|
|
|
|
|
k => 'お刺身食え食え', |
20
|
|
|
|
|
|
|
l => 'お刺身ドボドボ', |
21
|
|
|
|
|
|
|
m => 'お刺身お刺身', |
22
|
|
|
|
|
|
|
n => 'お刺身むむ・・・', |
23
|
|
|
|
|
|
|
o => 'お刺身アジフライ', |
24
|
|
|
|
|
|
|
p => 'アジ食え食え', |
25
|
|
|
|
|
|
|
q => 'アジドボドボ', |
26
|
|
|
|
|
|
|
r => 'アジお刺身', |
27
|
|
|
|
|
|
|
s => 'アジむむ・・・', |
28
|
|
|
|
|
|
|
t => 'アジアジフライ', |
29
|
|
|
|
|
|
|
u => 'ドボ食え食え', |
30
|
|
|
|
|
|
|
v => 'ドボドボドボ', |
31
|
|
|
|
|
|
|
w => 'ドボお刺身', |
32
|
|
|
|
|
|
|
x => 'ドボむむ・・・', |
33
|
|
|
|
|
|
|
y => 'ドボアジフライ', |
34
|
|
|
|
|
|
|
z => '山岡食え食え', |
35
|
|
|
|
|
|
|
A => '山岡ドボドボ', |
36
|
|
|
|
|
|
|
B => '山岡お刺身', |
37
|
|
|
|
|
|
|
C => '山岡むむ・・・', |
38
|
|
|
|
|
|
|
D => '山岡アジフライ', |
39
|
|
|
|
|
|
|
E => '岡星食え食え', |
40
|
|
|
|
|
|
|
F => '岡星ドボドボ', |
41
|
|
|
|
|
|
|
G => '岡星お刺身', |
42
|
|
|
|
|
|
|
H => '岡星むむ・・・', |
43
|
|
|
|
|
|
|
I => '岡星アジフライ', |
44
|
|
|
|
|
|
|
J => 'ゴク・・・食え食え', |
45
|
|
|
|
|
|
|
K => 'ゴク・・・ドボドボ', |
46
|
|
|
|
|
|
|
L => 'ゴク・・・お刺身', |
47
|
|
|
|
|
|
|
M => 'ゴク・・・むむ・・・', |
48
|
|
|
|
|
|
|
N => 'ゴク・・・アジフライ', |
49
|
|
|
|
|
|
|
O => 'ああ食え食え', |
50
|
|
|
|
|
|
|
P => 'ああドボドボ', |
51
|
|
|
|
|
|
|
Q => 'ああお刺身', |
52
|
|
|
|
|
|
|
R => 'ああむむ・・・', |
53
|
|
|
|
|
|
|
S => 'ああアジフライ', |
54
|
|
|
|
|
|
|
T => '雄山食え食え', |
55
|
|
|
|
|
|
|
U => '雄山ドボドボ', |
56
|
|
|
|
|
|
|
V => '雄山お刺身', |
57
|
|
|
|
|
|
|
W => '雄山むむ・・・', |
58
|
|
|
|
|
|
|
X => '雄山アジフライ', |
59
|
|
|
|
|
|
|
Y => '京極食え食え', |
60
|
|
|
|
|
|
|
Z => '京極ドボドボ', |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
0 => '京極お刺身', |
63
|
|
|
|
|
|
|
1 => '京極むむ・・・', |
64
|
|
|
|
|
|
|
2 => '京極アジフライ', |
65
|
|
|
|
|
|
|
3 => '陶人食え食え', |
66
|
|
|
|
|
|
|
4 => '陶人ドボドボ', |
67
|
|
|
|
|
|
|
5 => '陶人お刺身', |
68
|
|
|
|
|
|
|
6 => '陶人むむ・・・', |
69
|
|
|
|
|
|
|
7 => '陶人アジフライ', |
70
|
|
|
|
|
|
|
8 => '社主食え食え', |
71
|
|
|
|
|
|
|
9 => '社主ドボドボ', |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
space => '中川', |
74
|
3
|
|
|
3
|
|
15
|
}; |
|
3
|
|
|
|
|
3
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub new { |
77
|
3
|
|
|
3
|
1
|
43
|
my $class = shift; |
78
|
3
|
|
|
|
|
11
|
return $class; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub to_AjiFry { |
82
|
10
|
|
|
10
|
1
|
3110
|
my ( $self, $raw_string ) = @_; |
83
|
10
|
|
|
|
|
24
|
my $chomped = chomp($raw_string); |
84
|
|
|
|
|
|
|
|
85
|
10
|
100
|
|
|
|
24
|
unless ($raw_string) { |
86
|
1
|
50
|
|
|
|
10
|
return "\n" if $chomped; |
87
|
1
|
|
|
|
|
5
|
return ''; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
9
|
|
|
|
|
35
|
$raw_string = decode_utf8($raw_string); |
91
|
9
|
|
|
|
|
267
|
my $ajifry_word = $self->_to_ajifry($raw_string); |
92
|
9
|
50
|
|
|
|
50
|
$ajifry_word .= "\n" if $chomped; |
93
|
9
|
|
|
|
|
29
|
return encode_utf8($ajifry_word); |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub translate_to_ajifry { |
97
|
1
|
|
|
1
|
0
|
365
|
my ( $self, $raw_string ) = @_; |
98
|
1
|
|
|
|
|
4
|
return $self->to_AjiFry($raw_string); |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub to_English { |
102
|
5
|
|
|
5
|
1
|
32
|
my ( $self, $ajifry_word ) = @_; |
103
|
5
|
|
|
|
|
12
|
my $chomped = chomp($ajifry_word); |
104
|
|
|
|
|
|
|
|
105
|
5
|
50
|
|
|
|
16
|
unless ($ajifry_word) { |
106
|
0
|
0
|
|
|
|
0
|
return "\n" if $chomped; |
107
|
0
|
|
|
|
|
0
|
return ''; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
5
|
|
|
|
|
16
|
$ajifry_word = Encode::decode_utf8($ajifry_word); |
111
|
4
|
|
|
|
|
95
|
my $translated_word = $self->_to_English($ajifry_word); |
112
|
4
|
50
|
|
|
|
10
|
$translated_word .= "\n" if $chomped; |
113
|
4
|
|
|
|
|
13
|
return encode_utf8($translated_word); |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
sub translate_from_ajifry { |
117
|
0
|
|
|
0
|
0
|
0
|
my ( $self, $ajifry_word ) = @_; |
118
|
0
|
|
|
|
|
0
|
return $self->to_English($ajifry_word); |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub _to_ajifry { |
122
|
9
|
|
|
9
|
|
13
|
my $self = shift; |
123
|
9
|
|
|
|
|
13
|
my $raw_string = shift; |
124
|
|
|
|
|
|
|
|
125
|
9
|
|
|
|
|
74
|
my @raw_chars = split //, $raw_string; |
126
|
9
|
|
|
|
|
17
|
my $ajifry_word; |
127
|
9
|
|
|
|
|
20
|
foreach my $raw_char (@raw_chars) { |
128
|
172
|
50
|
|
|
|
489
|
if ( $raw_char eq ' ' ) { |
|
|
100
|
|
|
|
|
|
129
|
0
|
|
|
|
|
0
|
$ajifry_word .= MAP->{space}; |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
elsif ( $raw_char =~ /[a-zA-Z0-9]/ ) { |
132
|
160
|
|
|
|
|
340
|
$ajifry_word .= MAP->{$raw_char}; |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
else { |
135
|
12
|
|
|
|
|
18
|
$ajifry_word .= $raw_char; |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
9
|
|
|
|
|
35
|
return $ajifry_word; |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
sub _to_English { |
143
|
4
|
|
|
4
|
|
5
|
my $self = shift; |
144
|
4
|
|
|
|
|
6
|
my $ajifry_word = shift; |
145
|
|
|
|
|
|
|
|
146
|
4
|
|
|
|
|
4
|
my $translated_word; |
147
|
4
|
|
|
|
|
8
|
while ($ajifry_word) { |
148
|
81
|
|
|
|
|
83
|
my $match = 0; |
149
|
|
|
|
|
|
|
|
150
|
81
|
|
|
|
|
82
|
my $map = MAP; |
151
|
81
|
|
|
|
|
74
|
foreach my $key ( keys %{$map} ) { |
|
81
|
|
|
|
|
535
|
|
152
|
2800
|
100
|
|
|
|
24277
|
if ( $ajifry_word =~ s/^$map->{$key}// ) { |
153
|
75
|
|
|
|
|
75
|
$match = 1; |
154
|
75
|
50
|
|
|
|
112
|
if ( $key eq 'space' ) { |
155
|
0
|
|
|
|
|
0
|
$translated_word .= ' '; |
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
else { |
158
|
75
|
|
|
|
|
81
|
$translated_word .= $key; |
159
|
|
|
|
|
|
|
} |
160
|
75
|
|
|
|
|
105
|
last; |
161
|
|
|
|
|
|
|
} |
162
|
|
|
|
|
|
|
} |
163
|
|
|
|
|
|
|
|
164
|
81
|
100
|
|
|
|
429
|
unless ($match) { |
165
|
6
|
|
|
|
|
21
|
$ajifry_word =~ s/^(.)//; |
166
|
6
|
|
|
|
|
20
|
$translated_word .= $1; |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
|
170
|
4
|
|
|
|
|
11
|
return $translated_word; |
171
|
|
|
|
|
|
|
} |
172
|
|
|
|
|
|
|
1; |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
__END__ |