Sorahane AQUA-アクア
Browse files- v-corpus-zh/Sorahane/AQUA/1共通.txt.map.txt.gz +3 -0
- v-corpus-zh/Sorahane/AQUA/2千纱.txt.map.txt.gz +3 -0
- v-corpus-zh/Sorahane/AQUA/3奈奈璃.txt.map.txt.gz +3 -0
- v-corpus-zh/Sorahane/AQUA/4凛.txt.map.txt.gz +3 -0
- v-corpus-zh/Sorahane/AQUA/5LUKAS.txt.map.txt.gz +3 -0
- v-corpus-zh/Sorahane/AQUA/6AQUA.txt.map.txt.gz +3 -0
- v-corpus-zh/Sorahane/AQUA/7追加.txt.gz +3 -0
- v-corpus-zh/Sorahane/AQUA/AQUA_追加_ks.py +249 -0
v-corpus-zh/Sorahane/AQUA/1共通.txt.map.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5c7099fc88c5b94bb9fe6a3e185245158d3f98f239d06cdfad89131842852ddc
|
3 |
+
size 128338
|
v-corpus-zh/Sorahane/AQUA/2千纱.txt.map.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:13e72174ded87765d47f4e07aaad0ca7a490f35e6a34a33dd497deabaf0b4ab5
|
3 |
+
size 104790
|
v-corpus-zh/Sorahane/AQUA/3奈奈璃.txt.map.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:387d12f6a3697cb52e1e37fcd1134add526137d6762f79614715b66b2ed77c99
|
3 |
+
size 130669
|
v-corpus-zh/Sorahane/AQUA/4凛.txt.map.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:46f4fd9cbce2086def7f833679257502706e0d14f5218e9dfb44734751ebf4cd
|
3 |
+
size 119434
|
v-corpus-zh/Sorahane/AQUA/5LUKAS.txt.map.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d2169036b3d7ecdff3c983b6354796c5fbbacf268e6619dc4a122c11db6d0d48
|
3 |
+
size 100741
|
v-corpus-zh/Sorahane/AQUA/6AQUA.txt.map.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:183ccdeb13f4888d1c1d85c71d3d45d2a0b77bc3832617470306a388dc556815
|
3 |
+
size 87143
|
v-corpus-zh/Sorahane/AQUA/7追加.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:397e88108791873503dab6e5e49289d77c320bbc3ad03b5d345d1948c59bdde1
|
3 |
+
size 78916
|
v-corpus-zh/Sorahane/AQUA/AQUA_追加_ks.py
ADDED
@@ -0,0 +1,249 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.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 endsWithAny(s: str, keys):
|
47 |
+
for x in keys:
|
48 |
+
if s.endswith(x):
|
49 |
+
return x
|
50 |
+
else:
|
51 |
+
return False
|
52 |
+
|
53 |
+
|
54 |
+
def startsWithAlnum(s: str, _chrs):
|
55 |
+
retn = ''
|
56 |
+
for char in s:
|
57 |
+
if (char.isalnum()) or (char in _chrs):
|
58 |
+
retn += char
|
59 |
+
else:
|
60 |
+
break
|
61 |
+
return retn
|
62 |
+
|
63 |
+
|
64 |
+
def startsWithCmd(s: str, _chrs=None):
|
65 |
+
if _chrs is None:
|
66 |
+
_chrs = {'_', '@'}
|
67 |
+
cmd = startsWithAlnum(s, _chrs)
|
68 |
+
if cmd:
|
69 |
+
return s.startswith(cmd + ' ')
|
70 |
+
else:
|
71 |
+
return False
|
72 |
+
|
73 |
+
|
74 |
+
import re
|
75 |
+
|
76 |
+
reg_removeWait = re.compile(r'\[.+?]')
|
77 |
+
|
78 |
+
|
79 |
+
def removeWait(_line):
|
80 |
+
_tmp = reg_removeWait.sub('', _line)
|
81 |
+
if _tmp:
|
82 |
+
return _tmp
|
83 |
+
else:
|
84 |
+
return _line
|
85 |
+
|
86 |
+
|
87 |
+
def getCmdArgs(_cmd):
|
88 |
+
_args = ['']
|
89 |
+
_i = -1
|
90 |
+
_inQuota = ''
|
91 |
+
while _i < len(_cmd) - 1:
|
92 |
+
_i += 1
|
93 |
+
char = _cmd[_i]
|
94 |
+
if _inQuota:
|
95 |
+
_args[-1] += char
|
96 |
+
if char == _inQuota:
|
97 |
+
_inQuota = ''
|
98 |
+
elif char == '\\':
|
99 |
+
_i += 1
|
100 |
+
char = _cmd[_i]
|
101 |
+
_args[-1] += char
|
102 |
+
else:
|
103 |
+
pass
|
104 |
+
else:
|
105 |
+
if char == ' ':
|
106 |
+
_args.append('')
|
107 |
+
while _i < len(_cmd) - 1:
|
108 |
+
_i += 1
|
109 |
+
char = _cmd[_i]
|
110 |
+
if char != ' ':
|
111 |
+
_i -= 1
|
112 |
+
break
|
113 |
+
continue
|
114 |
+
elif char in {'"', "'"}:
|
115 |
+
_inQuota = char
|
116 |
+
else:
|
117 |
+
pass
|
118 |
+
_args[-1] += char
|
119 |
+
continue
|
120 |
+
return _args
|
121 |
+
|
122 |
+
|
123 |
+
def args2map(_args):
|
124 |
+
retn = {}
|
125 |
+
for _i in range(1, len(_args)):
|
126 |
+
_arg = _args[_i]
|
127 |
+
if '=' not in _arg:
|
128 |
+
if '=' in _arg:
|
129 |
+
_arg = _arg.replace('=', '=')
|
130 |
+
else:
|
131 |
+
continue
|
132 |
+
_idx = _arg.index('=')
|
133 |
+
_k = _arg[:_idx]
|
134 |
+
if '"' in _k or "'" in _k:
|
135 |
+
continue
|
136 |
+
_v = _arg[_idx + 1:]
|
137 |
+
if _v.startswith('"') or _v.startswith("'"):
|
138 |
+
_v = _v[1:len(_v) - 1]
|
139 |
+
retn[_k] = _v
|
140 |
+
return retn
|
141 |
+
|
142 |
+
|
143 |
+
# =================
|
144 |
+
|
145 |
+
a = get_all_files_in_directory(r'E:\tmp\AQUA_\ks', ext='.ks')
|
146 |
+
b = r'E:\tmp\AQUA_\追加'
|
147 |
+
|
148 |
+
# =================
|
149 |
+
|
150 |
+
sc = {}
|
151 |
+
|
152 |
+
_n = {
|
153 |
+
"夏荠": "夏荠",
|
154 |
+
"千纱/???": "千纱/?",
|
155 |
+
"千纱": "千纱",
|
156 |
+
"可可萝": "可可萝",
|
157 |
+
"健一郎": "健一郎",
|
158 |
+
"凛": "凛",
|
159 |
+
"俊介": "俊介",
|
160 |
+
"飒太": "飒太",
|
161 |
+
"智恵": "智恵",
|
162 |
+
"奈奈璃": "奈奈璃",
|
163 |
+
"沙织": "沙织",
|
164 |
+
"圭次": "圭次",
|
165 |
+
"千夏": "千夏",
|
166 |
+
"广播/少年": "广播/少年",
|
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 |
+
"可可萝/可可萝2号?": "可可萝&可可萝2号?",
|
193 |
+
"可可萝/可可萝2号": "可可萝&可可萝2号",
|
194 |
+
"夏荠/ ": "夏荠"
|
195 |
+
}
|
196 |
+
|
197 |
+
# =================
|
198 |
+
for path in a:
|
199 |
+
name = path[path.rindex('\\'):]
|
200 |
+
name = name[1:2]
|
201 |
+
if name.isdigit():
|
202 |
+
name = '0'
|
203 |
+
if name not in sc:
|
204 |
+
sc[name] = []
|
205 |
+
print(name)
|
206 |
+
# =================
|
207 |
+
|
208 |
+
with open(path, 'r', encoding='utf-16-le') as f:
|
209 |
+
next(f)
|
210 |
+
data = list(filter(lambda x: (not x.startswith(';')),
|
211 |
+
(x.rstrip() for x in f.readlines())))
|
212 |
+
|
213 |
+
# =================
|
214 |
+
w_i = -1
|
215 |
+
gn = '旁白'
|
216 |
+
while w_i < len(data) - 1:
|
217 |
+
w_i += 1
|
218 |
+
line: str = data[w_i]
|
219 |
+
# =================
|
220 |
+
if not line or startsWithAny(line, {'@', '*', '['}):
|
221 |
+
continue
|
222 |
+
# =================
|
223 |
+
if line.startswith('【'):
|
224 |
+
assert line.endswith('】')
|
225 |
+
n = line[1:len(line)-1]
|
226 |
+
if n in _n:
|
227 |
+
n = _n[n]
|
228 |
+
else:
|
229 |
+
_n[n] = clearT(n).replace('/', '&')
|
230 |
+
print(line)
|
231 |
+
gn = n
|
232 |
+
continue
|
233 |
+
|
234 |
+
d = clearT(line)
|
235 |
+
if d:
|
236 |
+
sc[name].append(gn + ':' + removeWait(d))
|
237 |
+
|
238 |
+
gn = '旁白'
|
239 |
+
|
240 |
+
# =================
|
241 |
+
|
242 |
+
for k, v in sc.items():
|
243 |
+
if v:
|
244 |
+
with open(b + f'\\{k}.txt', 'w', encoding='utf-8') as f:
|
245 |
+
f.write('\n'.join(v))
|
246 |
+
|
247 |
+
# =================
|
248 |
+
import json
|
249 |
+
tmp = json.dumps(_n, ensure_ascii=False, indent=4)
|