Datasets:

Languages:
Chinese
Tags:
Not-For-All-Audiences
License:
Limour commited on
Commit
bcc84fa
·
verified ·
1 Parent(s): 3d8304e

Upload 2 files

Browse files
视觉小说/format/MOMOIROSEHIKI/MOMOIROSEHIKI.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:874395d6e54d8ea2ae2468d44a4d09b3fee96272740b263dbe360a676b0260a6
3
+ size 400696
视觉小说/format/MOMOIROSEHIKI/tmp_MOMOIROSEHIKI.py ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from opencc import OpenCC
2
+ cc = OpenCC('t2s') # 't2s'表示繁体转简体
3
+ from h_corpus import Fileset
4
+ import unicodedata
5
+ import json
6
+ import re
7
+ def fullwidth_to_halfwidth(input_str):
8
+ return ''.join([unicodedata.normalize('NFKC', char) for char in input_str])
9
+
10
+ def clearT(s):
11
+ s = cc.convert(fullwidth_to_halfwidth(s))
12
+ return s.lstrip('n').strip().strip(r'\n').replace('\n', '\\n')
13
+
14
+ _n = {
15
+ "女学生A": "女学生A",
16
+ "女学生B": "女学生B",
17
+ "女学生C": "女学生C",
18
+ "幸助": "幸助",
19
+ "女学生ABC": "女学生A&B&C",
20
+ "女学生们": "女学生们",
21
+ "女学生D": "女学生D",
22
+ "女学生EFG": "女学生E&F&G",
23
+ "保安": "保安",
24
+ "???": "?",
25
+ "四月一日老师": "四月一日老师",
26
+ "龙胆": "龙胆",
27
+ "忍": "忍",
28
+ "千鹤": "千鹤",
29
+ "华恋": "华恋",
30
+ "茉樱": "茉樱",
31
+ "女学生A": "女学生A",
32
+ "女学生B": "女学生B",
33
+ "女学生C": "女学生C",
34
+ "音羽": "音羽",
35
+ "神楽": "神乐",
36
+ "昴": "昴",
37
+ "女学生E": "女学生E",
38
+ "引擎": "引擎",
39
+ "女学生F": "女学生F",
40
+ "女学生G": "女学生G",
41
+ "女学生H": "女学生H",
42
+ "英语老师": "英语老师",
43
+ "性教育老师": "性教育老师",
44
+ "学生代表": "学生代表",
45
+ "风": "风",
46
+ "女学生E・F・G": "女学生E&F&G",
47
+ "女学生I": "女学生I",
48
+ "振动棒": "振动棒",
49
+ "学生们": "学生们",
50
+ "女学生": "女学生",
51
+ "老师": "老师",
52
+ "搭讪男": "搭讪男",
53
+ "周围的人": "周围的人",
54
+ "女孩": "女孩",
55
+ "宿管员": "宿管员",
56
+ "管理员": "管理员",
57
+ "担任": "班委",
58
+ "生物老师": "生物老师",
59
+ "生徒一同": "学生们",
60
+ "人": "人",
61
+ "人A": "人A",
62
+ "人偶": "人偶",
63
+ "闹钟": "闹钟",
64
+ "千鹤\"可": "千鹤",
65
+ "服务生": "服务生",
66
+ "小孩子": "小孩子",
67
+ "男人们": "男人们",
68
+ "男A": "男A",
69
+ "男B": "男B",
70
+ "小狗": "小狗",
71
+ "子犬": "小狗",
72
+ "主婦": "主妇",
73
+ "人们": "人们",
74
+ "男声": "男声",
75
+ "女生": "女生",
76
+ "女声": "女声",
77
+ "做爱的情侣": "做爱的情侣",
78
+ "做爱的女性": "做爱的女性",
79
+ "人B": "人B",
80
+ "做爱的男性": "做爱的男性",
81
+ "大家": "大家",
82
+ "人A・B": "人A&B",
83
+ "人C": "人C",
84
+ "人D": "人D",
85
+ "街上的人们": "街上的人们",
86
+ "男C": "男C",
87
+ "企鹅": "企鹅",
88
+ "解说": "解说",
89
+ "CM": "CM",
90
+ "男D": "男D",
91
+ "女C": "女C",
92
+ "男G": "男G",
93
+ "女D": "女D",
94
+ "男H": "男H",
95
+ "女E": "女E",
96
+ "一起": "一起",
97
+ "婴儿": "婴儿",
98
+ "教师": "教师",
99
+ "幸助的班级的老师": "幸助的班级的老师",
100
+ "幸助同班同学A": "幸助同班同学A",
101
+ "幸助同班同学B": "幸助同班同学B",
102
+ "生徒達": "学生们",
103
+ "茉樱班级的老师": "茉樱班级的老师",
104
+ "同学们": "同学们",
105
+ "幸助班级的老师": "幸助班级的老师",
106
+ "姐": "姐",
107
+ "弟": "弟",
108
+ "店员": "店员",
109
+ "茉桜": "茉樱",
110
+ "路人": "路人",
111
+ "幸助・天使": "幸助&天使",
112
+ "幸助・恶魔": "幸助&恶魔",
113
+ "低年级学生1": "低年级学生1",
114
+ "低年级学生2": "低年级学生2",
115
+ "高年级生1": "高年级生1",
116
+ "高年级生2": "高年级生2",
117
+ "高年级生3": "高年级生3",
118
+ "高年级生達": "高年级生们",
119
+ "黑衣男": "黑衣男",
120
+ "店員": "店员",
121
+ "广播": "广播",
122
+ "校长": "校长",
123
+ "武藏": "武藏",
124
+ "女学生1": "女学生1",
125
+ "女学生2": "女学生2",
126
+ "神乐": "神乐",
127
+ "孩子": "孩子",
128
+ "子供": "孩子",
129
+ "武蔵": "武藏",
130
+ "": "旁白",
131
+ "竜胆": "龙胆",
132
+ "同学A": "同学A",
133
+ "同学B": "同学B",
134
+ "同学C": "同学C",
135
+ "年级主任": "年级主任",
136
+ "学校主任": "学校主任",
137
+ "走廊的女生A": "走廊的女生A",
138
+ "附近的女生B": "附近的女生B",
139
+ "猫": "猫",
140
+ "医生": "医生",
141
+ "華恋": "华恋",
142
+ "班级同学": "班级同学",
143
+ "玛欧酱": "玛欧酱"
144
+ }
145
+ a = Fileset(r'E:\tmp\MOMOIROSEHIKI', ext='.ks')
146
+ b = r'D:\datasets\b-corpus\视觉小说\format\MOMOIROSEHIKI\MOMOIROSEHIKI.txt'
147
+ regn = re.compile(r'name ?= ?(.*)')
148
+ sc = []
149
+ for i in range(len(a)):
150
+ with open(a[i], encoding='utf-16le') as f:
151
+ in_d = False
152
+ d = []
153
+ for line in f:
154
+ line = line.strip()
155
+ if not line:
156
+ continue
157
+ if line.startswith(';') or line.startswith('*'):
158
+ continue
159
+ if '[' not in line and in_d:
160
+ d.append(line)
161
+ continue
162
+ cache = ''
163
+ in_t = False
164
+ for one in line:
165
+ if one == '[':
166
+ in_t = True
167
+ if in_d:
168
+ d.append(cache)
169
+ cache = ''
170
+ continue
171
+ if one == ']':
172
+ in_t = False
173
+ cache = cache.strip()
174
+ if cache.startswith('CH_NAME'):
175
+ in_d = True
176
+ if cache.startswith('CH_NAME_OFF'):
177
+ n = '旁白'
178
+ else:
179
+ # print(line)
180
+ # print(cache)
181
+ tmp = regn.findall(cache)[0]
182
+ # print(tmp)
183
+ n = tmp.strip('"')
184
+ n = _n[n]
185
+ if cache.startswith('SYSTEM_MENU_ON'):
186
+ in_d = False
187
+ d = clearT(''.join(d))
188
+ if d:
189
+ sc.append(n + ':' + d)
190
+ d = []
191
+ cache = ''
192
+ continue
193
+ cache += one
194
+
195
+ with open(b, 'w', encoding='utf-8') as f:
196
+ f.write('\n'.join(sc))
197
+ tmp = json.dumps(_n, ensure_ascii=False, indent=2)