Datasets:

Languages:
Chinese
Tags:
Not-For-All-Audiences
License:
Limour commited on
Commit
d17a032
·
verified ·
1 Parent(s): 47bc3d1

魔女的夜宴

Browse files
v-corpus-zh/YUZUSOFT/15魔女的夜宴/0.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6150a0bf4452c3fbc735a315b719365d77766bff709566fda2b6953ccedfd777
3
+ size 247660
v-corpus-zh/YUZUSOFT/15魔女的夜宴/1.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:596645cf34591d60ff6e26495cb8f95c189f08a9c9ba818ec1f75169431247af
3
+ size 323876
v-corpus-zh/YUZUSOFT/15魔女的夜宴/2.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:605bbb2c70081b3cd149254ad415b29ba604eba3c1999697fafced91bb7c9e79
3
+ size 207035
v-corpus-zh/YUZUSOFT/15魔女的夜宴/3.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fbea4a0988c007d69523962558f323f9fd8c48c959a586e4cf64819c0d19cb69
3
+ size 183951
v-corpus-zh/YUZUSOFT/15魔女的夜宴/4.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c0021dcf5a3948464b5bc7a75c104cc368b5c94bb4d4e19ba90b7455c826cb96
3
+ size 234211
v-corpus-zh/YUZUSOFT/15魔女的夜宴/5.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:631e76dd4359c3fee81c48ab3889b6f0aacb775fe00d4cc48e94bae22d14e9cd
3
+ size 95068
v-corpus-zh/YUZUSOFT/15魔女的夜宴/魔女的夜宴_scn.py ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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().replace('\n', '\\n')
31
+
32
+ return _clearT
33
+
34
+
35
+ clearT = clearT()
36
+
37
+
38
+ # =================
39
+
40
+ a = get_all_files_in_directory(r'E:\tmp\魔女的夜宴_\scn\scn', ext='.ks.json')
41
+ b = r'E:\tmp\魔女的夜宴_\text'
42
+
43
+ # =================
44
+
45
+ sc = {}
46
+
47
+ _n = {
48
+ "女生": "女生",
49
+ "柊史": "柊史",
50
+ "男性": "男性",
51
+ "秀明": "秀明",
52
+ "和奏": "和奏",
53
+ "幻想中的和奏": "幻想中的和奏",
54
+ "和奏&柊史": "和奏&柊史",
55
+ "绫地": "绫地",
56
+ "女学生B": "女学生B",
57
+ "宁宁": "宁宁",
58
+ "女学生A": "女学生A",
59
+ "学生1": "学生1",
60
+ "学生2": "学生2",
61
+ "学生3": "学生3",
62
+ "图书委员": "图书委员",
63
+ "声音": "声音",
64
+ "老师": "老师",
65
+ "父亲": "父亲",
66
+ "太一": "太一",
67
+ "秋田": "秋田",
68
+ "男学生A": "男学生A",
69
+ "佳苗": "佳苗",
70
+ "同学": "同学",
71
+ "户隐学姐": "户隐学姐",
72
+ "憧子": "憧子",
73
+ "神秘的声音1": "神秘的声音1",
74
+ "神秘的声音2": "神秘的声音2",
75
+ "神秘的声音3": "神秘的声音3",
76
+ "神秘的声音4": "神秘的声音4",
77
+ "神秘的声音5": "神秘的声音5",
78
+ "七绪": "七绪",
79
+ "男学生B": "男学生B",
80
+ "和奏&秀明": "和奏&秀明",
81
+ "巡": "巡",
82
+ "宁宁&柊史": "宁宁&柊史",
83
+ "男学生C": "男学生C",
84
+ "女学生C": "女学生C",
85
+ "女同学A": "女同学A",
86
+ "女同学B": "女同学B",
87
+ "男同学A": "男同学A",
88
+ "男同学B": "男同学B",
89
+ "川上?": "川上?",
90
+ "川上": "川上",
91
+ "宁宁&巡&柊史": "宁宁&巡&柊史",
92
+ "职员": "职员",
93
+ "巡&柊史": "巡&柊史",
94
+ "店员": "店员",
95
+ "䌷": "䌷",
96
+ "越路": "越路",
97
+ "???": "?",
98
+ "男同学": "男同学",
99
+ "宁宁&巡&䌷": "宁宁&巡&䌷",
100
+ "教师A": "教师A",
101
+ "求助者A": "求助者A",
102
+ "机器": "机器",
103
+ "求助者": "求助者",
104
+ "巡&䌷": "巡&䌷",
105
+ "䌷&巡": "䌷&巡",
106
+ "䌷&憧子&柊史": "䌷&憧子&柊史",
107
+ "海道的熟人": "海道的熟人",
108
+ "学生会干事A": "学生会干事A",
109
+ "服饰社": "服饰社",
110
+ "女学生D": "女学生D",
111
+ "客人A": "客人A",
112
+ "客人B": "客人B",
113
+ "客人C": "客人C",
114
+ "全班": "全班",
115
+ "秀明&柊史": "秀明&柊史",
116
+ "巡&䌷&憧子": "巡&䌷&憧子",
117
+ "新闻社": "新闻社",
118
+ "巡&䌷&柊史": "巡&䌷&柊史",
119
+ "调查表": "调查表",
120
+ "全员": "全员",
121
+ "求助者B": "求助者B",
122
+ "宁宁&䌷&憧子&柊史": "宁宁&䌷&憧子&柊史",
123
+ "巡&䌷&憧子&柊史": "巡&䌷&憧子&柊史",
124
+ "三河": "三河",
125
+ "巡&憧子": "巡&憧子",
126
+ "店员&柊史": "店员&柊史",
127
+ "来求助的学生": "来求助的学生",
128
+ "宁宁&七绪": "宁宁&七绪",
129
+ "所有人": "所有人",
130
+ "宁宁的母亲": "宁宁的母亲",
131
+ "宁宁的父亲": "宁宁的父亲",
132
+ "女性": "女性",
133
+ "新田一美": "新田一美",
134
+ "宁宁的父亲&新田一美": "宁宁的父亲&新田一美",
135
+ "宁宁的同班同学B": "宁宁的同班同学B",
136
+ "宁宁的同班同学A": "宁宁的同班同学A",
137
+ "宁宁的同班同学C": "宁宁的同班同学C",
138
+ "宁宁的同班同学们": "宁宁的同班同学们",
139
+ "宁宁的同班同学D": "宁宁的同班同学D",
140
+ "宁宁的同班同学E": "宁宁的同班同学E",
141
+ "宁宁的同班同学F": "宁宁的同班同学F",
142
+ "主妇A": "主妇A",
143
+ "主妇B": "主妇B",
144
+ "学长E": "学长E",
145
+ "学长F": "学长F",
146
+ "学弟A": "学弟A",
147
+ "学弟B": "学弟B",
148
+ "两位学弟": "两位学弟",
149
+ "巡&川上": "巡&川上",
150
+ "巡&和奏&川上": "巡&和奏&川上",
151
+ "电影": "电影",
152
+ "䌷&憧子": "䌷&憧子",
153
+ "大家一起": "大家一起",
154
+ "母亲": "母亲",
155
+ "憧子&䌷": "憧子&䌷",
156
+ "宁宁&䌷": "宁宁&䌷",
157
+ "巡的母亲": "巡的母亲",
158
+ "幼女": "幼女",
159
+ "赤木": "赤木",
160
+ "宁宁&䌷&柊史": "宁宁&䌷&柊史",
161
+ "乙女游戏的攻略对象": "乙女游戏的攻略对象",
162
+ "巡的心灵碎片": "巡的心灵碎片",
163
+ "学妹": "学妹",
164
+ "乌鸦": "乌鸦",
165
+ "男生": "男生",
166
+ "女学生": "女学生",
167
+ "男生A": "男生A",
168
+ "男生B": "男生B",
169
+ "厚真": "厚真",
170
+ "小狗": "小狗",
171
+ "小孩A": "小孩A",
172
+ "玩偶": "玩偶",
173
+ "行人": "行人",
174
+ "亲戚A": "亲戚A",
175
+ "亲戚B": "亲戚B",
176
+ "老年犬": "老年犬",
177
+ "老奶奶": "老奶奶",
178
+ "求助者C": "求助者C",
179
+ "篮球社社员": "篮球社社员",
180
+ "篮球社社员们": "篮球社社员们",
181
+ "篮球社社员A": "篮球社社员A",
182
+ "篮球社社员C": "篮球社社员C",
183
+ "篮球社社员B": "篮球社社员B",
184
+ "男同学们": "男同学们",
185
+ "生理老师": "生理老师",
186
+ "憧子&柊史": "憧子&柊史",
187
+ "AV": "AV",
188
+ "宁宁&䌷&巡&柊史": "宁宁&䌷&巡&柊史",
189
+ "宁宁&䌷&巡": "宁宁&䌷&巡",
190
+ "服装店店员": "服装店店员",
191
+ "秀明&和奏": "秀明&和奏",
192
+ "观众1": "观众1",
193
+ "观众2": "观众2",
194
+ "观众3": "观众3",
195
+ "观众4": "观众4",
196
+ "观众5": "观众5",
197
+ "观众6": "观众6",
198
+ "全体观众": "全体观众",
199
+ "观众7": "观众7",
200
+ "观众8": "观众8",
201
+ "观众9": "观众9"
202
+ }
203
+
204
+ # =================
205
+ import json
206
+
207
+ for path in a:
208
+ name = path[path.rindex('\\') + 1:]
209
+ name = name[0]
210
+ if name not in sc:
211
+ sc[name] = []
212
+ print(name)
213
+ # =================
214
+
215
+ with open(path, 'r', encoding='utf-8') as json_file:
216
+ data = json.load(json_file)
217
+
218
+ # =================
219
+ for texts in data['scenes']:
220
+ try:
221
+ for texts in texts['texts']:
222
+ # print(texts)
223
+ texts = texts[1][1]
224
+
225
+ n = texts[0]
226
+ if not n:
227
+ n = '旁白'
228
+ else:
229
+ if n in _n:
230
+ n = _n[n]
231
+ else:
232
+ _n[n] = clearT(n).replace('・', '&')
233
+ print(texts, n)
234
+
235
+ # =================
236
+ d = clearT(texts[1])
237
+ if d:
238
+ sc[name].append(n + ':' + d)
239
+
240
+ except KeyError:
241
+ if type(texts) is not dict:
242
+ print(texts)
243
+
244
+ # =================
245
+
246
+ for k, v in sc.items():
247
+ if v:
248
+ with open(b + f'\\{k}.txt', 'w', encoding='utf-8') as f:
249
+ f.write('\n'.join(v))
250
+
251
+ # =================
252
+ import json
253
+ tmp = json.dumps(_n, ensure_ascii=False, indent=4)