Skip to content

Commit f9d64b1

Browse files
committed
decode something
1 parent 52460ce commit f9d64b1

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

py/e/a.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import sys
2+
3+
4+
def convert_vowel(x):
5+
return [
6+
"_",
7+
"k",
8+
"s",
9+
"t",
10+
"n",
11+
"h",
12+
"m",
13+
"y",
14+
"r",
15+
"w",
16+
"nn",
17+
][x - 1]
18+
19+
20+
def convert_consonant(x):
21+
return [
22+
"a",
23+
"i",
24+
"u",
25+
"e",
26+
"o",
27+
][x - 1]
28+
29+
30+
def convert_letter(v, c):
31+
if v == 11 and c == 1:
32+
return "nn"
33+
return convert_vowel(v) + "-" + convert_consonant(c)
34+
35+
36+
l = sys.stdin.read()
37+
print(l)
38+
xs = l.split(",")
39+
for x in xs:
40+
vowel_str, consonant_str = x.split(".")
41+
vowel = int(vowel_str)
42+
consonant = int(consonant_str)
43+
print(f"{vowel:2} {consonant} => {convert_letter(vowel, consonant)}")

py/e/text

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.2,11.1,5.1,3.2,8.3,2.4,11.1,4.5,2.1,2.1,11.1,6.1,9.5,1.3

0 commit comments

Comments
 (0)