-
Notifications
You must be signed in to change notification settings - Fork 1
/
processor.py
49 lines (35 loc) · 1009 Bytes
/
processor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import logging
import sys
import click
from chhoe_taigi_db_parser import ChhoeTaigiDBParser
logging.basicConfig(stream=sys.stderr)
logger = logging.getLogger()
def print_header():
print("%gen_inp")
print("%ename kip-tailo")
print("%cname 教羅")
print("%encoding UTF-8")
print("%selkey qwdfzxyv")
print_keyname()
print("%chardef begin", end="")
def print_keyname():
skip_list = "qwdfzxyzv"
print("%keyname begin")
for i in range(1,10):
print(f"{i} {i}")
for c in range(26):
ch = chr(ord('a') + c)
if ch in skip_list:
continue
print(f"{ch} {ch}")
print("%keyname end")
def print_footer():
print("%chardef end")
def main():
parser = ChhoeTaigiDBParser("ChhoeTaigiDatabase/ChhoeTaigiDatabase/ChhoeTaigi_KauiokpooTaigiSutian.csv")
print_header()
print(parser.parse())
print_footer()
if __name__ == "__main__":
logger.info("Processing ChhoeTaigi DataBase to cin file...")
main()