Datasets:

Languages:
Chinese
Tags:
Not-For-All-Audiences
License:
Limour commited on
Commit
75f1e76
·
verified ·
1 Parent(s): 4274f0b

苹果妹,无H版

Browse files
v-corpus-zh/AKABEiSOFT2/若能与你再次相见/ゆめルート.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e17fa88e27695def4d823b16a0db7bf306e6e276d52fbabe83166bf494769e7
3
+ size 139155
v-corpus-zh/AKABEiSOFT2/若能与你再次相见/グランドルート.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff1f773cc67eecdb63d37d296b3b4551a591064492f660b94fea93418d548bf6
3
+ size 131975
v-corpus-zh/AKABEiSOFT2/若能与你再次相见/共通ルート.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c9515c87a9b419a4468032ddb11be749c2e41024dbf08281d8291a2b8de500e
3
+ size 91322
v-corpus-zh/AKABEiSOFT2/若能与你再次相见/未喜ルート.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09c8672463b0782648681eddfd8014767da7c624dc41517ed02f2d042f1edc98
3
+ size 173050
v-corpus-zh/AKABEiSOFT2/若能与你再次相见/苹果_ks.py ADDED
@@ -0,0 +1,308 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def get_all_files_in_directory(directory, ext=''):
2
+ import os
3
+ import re
4
+ custom_sort_key_re = re.compile('([0-9]+)')
5
+
6
+ def custom_sort_key(s):
7
+ # 将字符串中的数字部分转换为整数,然后进行排序
8
+ return [int(x) if x.isdigit() else x for x in custom_sort_key_re.split(s)]
9
+
10
+ all_files = []
11
+ for root, dirs, files in os.walk(directory):
12
+ for file in files:
13
+ if file.endswith(ext):
14
+ file_path = os.path.join(root, file)
15
+ all_files.append(file_path)
16
+ return sorted(all_files, key=custom_sort_key)
17
+
18
+
19
+ def clearT():
20
+ import unicodedata
21
+ from opencc import OpenCC
22
+
23
+ def full2half(input_str):
24
+ return ''.join([unicodedata.normalize('NFKC', char) for char in input_str])
25
+
26
+ cc = OpenCC('t2s') # 't2s'表示繁体转简体
27
+
28
+ def _clearT(s):
29
+ s = cc.convert(full2half(s))
30
+ return s.lstrip('n').strip().strip(r'\n').replace('\n', '\\n')
31
+
32
+ return _clearT
33
+
34
+
35
+ clearT = clearT()
36
+
37
+
38
+ def startsWithAny(s: str, keys):
39
+ for x in keys:
40
+ if s.startswith(x):
41
+ return x
42
+ else:
43
+ return False
44
+
45
+
46
+ def startsWithAlnum(s: str, _chrs):
47
+ retn = ''
48
+ for char in s:
49
+ if (char.isalnum()) or (char in _chrs):
50
+ retn += char
51
+ else:
52
+ break
53
+ return retn
54
+
55
+
56
+ def startsWithCmd(s: str, _chrs=None):
57
+ if _chrs is None:
58
+ _chrs = {'_', '@'}
59
+ cmd = startsWithAlnum(s, _chrs)
60
+ if cmd:
61
+ return s.startswith(cmd + ' ')
62
+ else:
63
+ return False
64
+
65
+
66
+ import re
67
+
68
+ reg_removeWait = re.compile(r'\[.+?]')
69
+
70
+
71
+ def removeWait(_line):
72
+ _tmp = reg_removeWait.sub('', _line)
73
+ if _tmp:
74
+ return _tmp
75
+ else:
76
+ return _line
77
+
78
+
79
+ def getCmdArgs(_cmd):
80
+ _args = ['']
81
+ _i = -1
82
+ _inQuota = ''
83
+ while _i < len(_cmd) - 1:
84
+ _i += 1
85
+ char = _cmd[_i]
86
+ if _inQuota:
87
+ _args[-1] += char
88
+ if char == _inQuota:
89
+ _inQuota = ''
90
+ elif char == '\\':
91
+ _i += 1
92
+ char = _cmd[_i]
93
+ _args[-1] += char
94
+ else:
95
+ pass
96
+ else:
97
+ if char == ' ':
98
+ _args.append('')
99
+ while _i < len(_cmd) - 1:
100
+ _i += 1
101
+ char = _cmd[_i]
102
+ if char != ' ':
103
+ _i -= 1
104
+ break
105
+ continue
106
+ elif char in {'"', "'"}:
107
+ _inQuota = char
108
+ else:
109
+ pass
110
+ _args[-1] += char
111
+ continue
112
+ return _args
113
+
114
+
115
+ def args2map(_args):
116
+ retn = {}
117
+ for _i in range(1, len(_args)):
118
+ _arg = _args[_i]
119
+ if '=' not in _arg:
120
+ continue
121
+ _idx = _arg.index('=')
122
+ _k = _arg[:_idx]
123
+ if '"' in _k or "'" in _k:
124
+ continue
125
+ _v = _arg[_idx + 1:]
126
+ if _v.startswith('"') or _v.startswith("'"):
127
+ _v = _v[1:len(_v) - 1]
128
+ retn[_k] = _v
129
+ return retn
130
+
131
+
132
+ # =================
133
+
134
+ def listRfind_idx(_i, _data, _condition):
135
+ for j in range(_i - 1, -1, -1):
136
+ if _condition(_data[j]):
137
+ return j
138
+ return _i
139
+
140
+
141
+ def listRfind(_i, _data, _condition, _filter, delta=1):
142
+ return list(filter(_filter, _data[listRfind_idx(_i, _data, _condition) + delta:_i + 1]))
143
+
144
+ # =================
145
+
146
+ a = get_all_files_in_directory(r'E:\tmp\苹果妹\ks', ext='.ks')
147
+ b = r'D:\datasets\tmp'
148
+
149
+ # =================
150
+
151
+ sc = {}
152
+
153
+ _n = {
154
+ "蓝里": "蓝里",
155
+ "陆": "陆",
156
+ "老婆婆": "老婆婆",
157
+ "青年": "青年",
158
+ "少女/ゆめ": "少女/梦", # 栗原梦
159
+ "陸": "陆",
160
+ "少女の声/ゆめ": "少女的声音/梦",
161
+ "梦": "梦",
162
+ "ゆめ": "梦",
163
+ "涟": "涟",
164
+ "陆 ": "陆",
165
+ "男1": "男1",
166
+ "男2": "男2",
167
+ "中年男性": "中年男性",
168
+ "手汗很重的中年男性/中年男": "手汗很重的中年男性",
169
+ "感受到命运的中年男性/中年男": "感受到命运的中年男性/",
170
+ "邀请得很直接的中年男性/中年男": "邀请得很直接的中年男性",
171
+ "死缠烂打的中年男性/中年男": "死缠烂打的中年男性",
172
+ "呼吸急促的中年男性/中年男": "呼吸急促的中年男性",
173
+ "就这样呼吸急促地靠近过来的中年男性/中年男": "就这样呼吸急促地靠近过来的中年男性",
174
+ "少女/美羽": "少女/美羽",
175
+ "美羽": "美羽",
176
+ "アナウンサー": "广播",
177
+ "未喜": "未喜",
178
+ "笃史": "笃史",
179
+ "工人": "工人",
180
+ "声音/梦": "声音/梦",
181
+ "男人": "男人",
182
+ "铃声": "铃声",
183
+ "声/美羽": "声/美羽",
184
+ "アナウンス": "广播",
185
+ "声音/梦的母亲": "声音/梦的母亲",
186
+ "梦的母亲": "梦的母亲",
187
+ "漣": "涟",
188
+ "声/涟": "声/涟",
189
+ "少女的声音/奈月": "少女的声音/奈月",
190
+ "少女/奈月": "少女/奈月",
191
+ "奈月": "奈月",
192
+ "詩乃": "诗乃",
193
+ "看護師": "护士",
194
+ "诗乃": "诗乃",
195
+ "诗乃乃": "诗乃乃",
196
+ "少女A/部员A": "少女A/部员A",
197
+ "少女B/部员B": "少女B/部员B",
198
+ "少女C/部员C": "少女C/部员C",
199
+ "声/詩乃の母": "声/诗乃的母亲",
200
+ "诗乃的母亲": "诗乃的母亲",
201
+ "诗乃的父亲": "诗乃的父亲",
202
+ "八百屋": "八百屋",
203
+ "女性的声音/漣": "女性的声音/涟",
204
+ "少女的声音/詩乃": "少女的声音/诗乃",
205
+ "少女/詩乃": "少女/诗乃",
206
+ "女孩": "女孩",
207
+ "母亲": "母亲",
208
+ "男/篤史": "男/笃史",
209
+ "少女的声音/未喜": "少女的声音/未喜",
210
+ "少女/未喜": "少女/未喜",
211
+ "少女的声音/藍里": "少女的声音/蓝里",
212
+ "少女的声音/ゆめ": "少女的声音/梦",
213
+ "女性/香澄": "女性/香澄",
214
+ "声/未喜": "声/未喜",
215
+ "裁判": "裁判",
216
+ "声/藍里": "声/蓝里",
217
+ "少女A/部員A": "少女A/部员A",
218
+ "少女B/部員B": "少女B/部员B",
219
+ "少女C/部員C": "少女C/部员C",
220
+ "客A": "客A",
221
+ "俳優A": "俳优A",
222
+ "俳優B": "俳优B",
223
+ "司会者": "司会者",
224
+ "トム": "汤姆",
225
+ "篤史": "笃史",
226
+ "客B": "客B",
227
+ "藍里": "蓝里",
228
+ "香澄": "香澄",
229
+ "店員": "店员",
230
+ "主持人": "主持人",
231
+ "客1": "客1",
232
+ "声/香澄": "声/香澄",
233
+ "露": "露",
234
+ "少女/由美子": "少女/由美子",
235
+ "由美子": "由美子",
236
+ "声/詩乃": "声/诗乃",
237
+ "部員A": "部员A",
238
+ "部員B": "部员B",
239
+ "部員C": "部员C",
240
+ "部員D": "部员D",
241
+ "蔬果商": "蔬果商",
242
+ "子供": "小孩子",
243
+ "母親": "母亲",
244
+ "係員": "系员",
245
+ "詩乃の母": "诗乃的母亲",
246
+ "詩乃の父": "诗乃的父亲"
247
+ }
248
+
249
+ # =================
250
+ for path in a:
251
+ name = path[path.rindex('\\'):]
252
+ name = name[:name.rindex('_')]
253
+ if name not in sc:
254
+ sc[name] = []
255
+ print(name)
256
+ # =================
257
+
258
+ with open(path, 'r', encoding='utf-16-le') as f:
259
+ next(f) # BOM
260
+ data = list(filter(lambda x: not x.startswith(';'), (x.strip() for x in f.readlines())))
261
+
262
+ w_i = -1
263
+ while w_i < len(data) - 1:
264
+ w_i += 1
265
+ line = data[w_i]
266
+ if not line.endswith('[np]'):
267
+ continue
268
+ tmp = listRfind(w_i, data,
269
+ lambda x: x.startswith('@nm ') or x.endswith('[np]'),
270
+ lambda x: x, delta=0)
271
+ if len(tmp) > 1 and tmp[0].endswith('[np]'):
272
+ tmp = tmp[1:]
273
+ else:
274
+ if not tmp:
275
+ continue
276
+ line = tmp[0]
277
+ if line.startswith('@nm '):
278
+ args = args2map(getCmdArgs(line))
279
+ n = args['t']
280
+ if not n and 'rt' in args:
281
+ n = args['rt']
282
+ else:
283
+ if 'rt' in args:
284
+ n += '/' + args['rt']
285
+ if n in _n:
286
+ n = _n[n]
287
+ else:
288
+ _n[n] = clearT(n)
289
+ print(line)
290
+ tmp = tmp[1:]
291
+ else:
292
+ n = '旁白'
293
+ tmp = (removeWait(x) for x in tmp if not x.isascii())
294
+ d = '\\n'.join(removeWait(x) for x in tmp if x and not startsWithCmd(x, {'_', '@', '*', '['}))
295
+ d = clearT(d)
296
+ if d:
297
+ sc[name].append(n + ':' + d)
298
+
299
+ # =================
300
+
301
+ for k, v in sc.items():
302
+ with open(b + f'\\{k}.txt', 'w', encoding='utf-8') as f:
303
+ f.write('\n'.join(v))
304
+
305
+ # =================
306
+ import json
307
+
308
+ tmp = json.dumps(_n, ensure_ascii=False, indent=2)
v-corpus-zh/AKABEiSOFT2/若能与你再次相见/藍里ルート.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ef27cb5a87dfefbd6af22b282bf5814bcae4d80406a0ddd0ed9aacf9cf575f12
3
+ size 171866
v-corpus-zh/AKABEiSOFT2/若能与你再次相见/詩乃ルート.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:306875fe794dab92e257c3be4bc19bf2d1996febb8891325689423c3b6d2cdc6
3
+ size 161841