Datasets:

Languages:
Chinese
Tags:
Not-For-All-Audiences
License:
Limour commited on
Commit
82d7545
·
verified ·
1 Parent(s): b6ac404

Upload 7 files

Browse files
v-corpus-zh/ωstar/万华镜/30/03.txt.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:15e2cf026ab9f343d6c1588909ffd19e9a2c2821f8403134bc2ed033d87d8b4f
3
- size 416265
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f9a41e5210dbd18b666578d56aa15f55a965ee70a1a241337d841e8768673c4
3
+ size 411496
v-corpus-zh/ωstar/万华镜/40/4.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6293a69e0985b179590a8b03ced956c51217d444589aa4d49e402d6e3844ccc5
3
+ size 320581
v-corpus-zh/ωstar/万华镜/50/5.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c3c92cc154a6695dc539e32ef617ac97751feb389dba9eb04228694c7bf4b778
3
+ size 631662
v-corpus-zh/ωstar/万华镜/50/nt2txt.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # https://nnnewb.github.io/blog/p/go%E8%AF%AD%E8%A8%80%E5%AE%9E%E6%88%98%E4%B9%8B%E8%A7%A3%E5%AF%86ons%E8%84%9A%E6%9C%AC/
2
+ with open(r'H:\【移植】【汉化】美少女万华镜5 v5.0\nscript.dat', 'rb') as fi:
3
+ buf = bytearray(fi.read())
4
+ nt2 = False
5
+ if nt2:
6
+ for i in range(len(buf)):
7
+ buf[i] = (buf[i] ^ (0x85 & 0x97)) - 1
8
+ else:
9
+ for i in range(len(buf)):
10
+ buf[i] ^= 0x84
11
+ with open(r'E:\tmp\万花镜\5.txt', 'wb') as fo:
12
+ fo.write(buf)
v-corpus-zh/ωstar/万华镜/50/万花镜_04_ns.py ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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, _l = False):
47
+ retn = ''
48
+ for char in s:
49
+ if char.isalnum() or (_l and char == '_'):
50
+ retn += char
51
+ else:
52
+ break
53
+ return retn
54
+
55
+
56
+ def startsWithCmd(s: str):
57
+ cmd = startsWithAlnum(line, _l=True)
58
+ if cmd:
59
+ return s.startswith(cmd + ' ')
60
+ else:
61
+ return False
62
+ # =================
63
+
64
+ a = get_all_files_in_directory(r'E:\tmp\万花镜', ext='.txt')
65
+ b = r'D:\datasets\tmp'
66
+
67
+ # =================
68
+
69
+ sc = {}
70
+
71
+ _n = {
72
+ "深见": "深见",
73
+ "女招待": "女招待",
74
+ "莲华": "莲华",
75
+ "夕纪夫": "夕纪夫",
76
+ "夕摩": "夕摩",
77
+ "高桥秘书": "高桥秘书",
78
+ "另一个自己": "另一个自己",
79
+ "???": "?",
80
+ "夕莉": "夕莉",
81
+ "路过的男人": "路过的男人",
82
+ "路过的女人": "路过的女人",
83
+ "礼次郎": "礼次郎",
84
+ "夕香里": "夕香里",
85
+ "女式内衣店店员": "女式内衣店店员",
86
+ "女客人A": "女客人A",
87
+ "女客人B": "女客人B",
88
+ "女学生A": "女学生A",
89
+ "女学生B": "女学生B",
90
+ "女学生C": "女学生C",
91
+ "班主任": "班主任",
92
+ "同班同学A": "同班同学A",
93
+ "同班同学B": "同班同学B",
94
+ "同班同学C": "同班同学C",
95
+ "镜子": "镜子",
96
+ "伊千果": "伊千果",
97
+ "咲": "咲",
98
+ "女学生D": "女学生D",
99
+ "男教师A": "男教师A",
100
+ "网球部部员A": "网球部部员A",
101
+ "网球部部员B": "网球部部员B",
102
+ "公寓住客": "公寓住客",
103
+ "女学生E": "女学生E",
104
+ "女学生F": "女学生F",
105
+ "女学生G": "女学生G",
106
+ "女学生H": "女学生H",
107
+ "女学生I": "女学生I",
108
+ "路人A": "路人A",
109
+ "路人B": "路人B",
110
+ "路人C": "路人C",
111
+ "路人D": "路人D",
112
+ "站务员": "站务员",
113
+ "上班族A": "上班族A",
114
+ "上班族B": "上班族B",
115
+ "护士": "护士",
116
+ "医生": "医生",
117
+ "少女": "少女",
118
+ "香恋": "香恋",
119
+ "春": "春",
120
+ "皇": "皇",
121
+ "新人厨师": "新人厨师",
122
+ "小狗": "小狗",
123
+ "校长": "校长",
124
+ "男老师": "男老师",
125
+ "女老师": "女老师",
126
+ "男性教师": "男性教师",
127
+ "女性教师": "女性教师",
128
+ "舞斗": "舞斗",
129
+ "老师们": "老师们",
130
+ "萌世歌": "萌世歌",
131
+ "女学生们": "女学生们",
132
+ "香恋&深见": "香恋&深见",
133
+ "莲华&深见": "莲华&深见",
134
+ "皇&深见": "皇&深见",
135
+ "奏": "奏",
136
+ "深见&莲华": "深见&莲华",
137
+ "香恋&深见": "香恋&深见",
138
+ "女学生": "女学生",
139
+ "女学生A&B": "女学生A&B",
140
+ "女子学生A": "女子学生A",
141
+ "女子学生B": "女子学生B",
142
+ "女子学生C": "女子学生C",
143
+ "沙织": "沙织",
144
+ "小狐": "小狐",
145
+ "和音": "和音",
146
+ "和音的母亲": "和音的母亲",
147
+ "狐": "狐",
148
+ "男性教師": "男性教师",
149
+ "丧尸管家": "丧尸管家",
150
+ "夏彦": "夏彦",
151
+ "母亲": "母亲",
152
+ "女儿": "女儿",
153
+ "小孩": "小孩",
154
+ "莲华&夏彦": "莲华&夏彦",
155
+ "莲华/夏彦": "莲华&夏彦",
156
+ "孩子的声音": "孩子的声音",
157
+ "疑似孩子母亲的人的声音": "疑似孩子母亲的人的声音",
158
+ "女生": "女生",
159
+ "男生": "男生",
160
+ "深见冬彦": "深见冬彦",
161
+ "白诘草": "白诘草"
162
+ }
163
+ # =================
164
+ import re
165
+ cselr = re.compile(r'(",\*)|(,")')
166
+ for path in a:
167
+ name = path[path.rindex('\\'):]
168
+ name = name[:2]
169
+ if name not in sc:
170
+ sc[name] = []
171
+ print(name)
172
+ # =================
173
+
174
+ with open(path, 'r', encoding='utf-8') as f:
175
+ data = list(filter(lambda x: not x.startswith(';'), (x.strip() for x in f.readlines())))
176
+
177
+ # =================
178
+ csel = {} # 分支选项
179
+ goto = set() # 懒得弄了
180
+ for line in data:
181
+ if line.startswith('chara'):
182
+ continue
183
+ if line.isascii():
184
+ if line.startswith('*'):
185
+ line = line[1:]
186
+ if line in goto:
187
+ continue
188
+
189
+ if line in csel:
190
+ line = csel[line]
191
+ else:
192
+ # print(line, csel)
193
+ continue
194
+ elif line.startswith('goto '):
195
+ goto.add(line[6:])
196
+ continue
197
+ else:
198
+ continue
199
+ if line.startswith('csel '):
200
+ line = line[5:]
201
+ line = cselr.split(line)
202
+ assert len(line) % 2 == 0
203
+ line = [x for x in line if (x is not None and x not in ('",*', ',"'))]
204
+ for i in range(0, len(line), 2):
205
+ csel[line[i+1]] = '选择:' + line[i].strip('"')
206
+ continue
207
+ if startsWithAny(line, ('se', '*', 'get', 'if', 'automode')) or startsWithCmd(line):
208
+ continue
209
+ tmp = line.split(']「')
210
+ if len(tmp) == 1:
211
+ if '] ' in tmp[0] or tmp[0].startswith('['):
212
+ print(line, tmp)
213
+ assert False
214
+ else:
215
+ n = '旁白'
216
+ elif len(tmp) == 2:
217
+ n = tmp[0].split('/')
218
+ if len(n) != 3:
219
+ assert n[1] in _n
220
+ n = n[1]
221
+ if n in _n:
222
+ n = _n[n]
223
+ else:
224
+ _n[n] = clearT(n)
225
+ print(line)
226
+ tmp[-1] = '「' + tmp[-1]
227
+ else:
228
+ print(tmp)
229
+ assert False
230
+ d = tmp[-1]
231
+ d = clearT(d)
232
+ if d:
233
+ sc[name].append(n + ':' + d)
234
+ # =================
235
+
236
+ for k, v in sc.items():
237
+ with open(b + f'\\{k}.txt', 'w', encoding='utf-8') as f:
238
+ f.write('\n'.join(v))
239
+
240
+ # =================
241
+ import json
242
+ tmp = json.dumps(_n, ensure_ascii=False, indent=2)