Datasets:

Languages:
Chinese
Tags:
Not-For-All-Audiences
License:
Limour commited on
Commit
2ada2d1
·
verified ·
1 Parent(s): 6f6a213

金辉恋曲四重奏 -Golden Time-

Browse files
v-corpus-zh/SAGAPLANETS/金辉恋曲四重奏/FD/0.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9213c268ca3df22635926aca6d8055570aaa4ded4fdfad4baf1a2054d8de8acf
3
+ size 770603
v-corpus-zh/SAGAPLANETS/金辉恋曲四重奏/FD/scn2json.bat ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ chcp 65001
2
+
3
+ @echo off
4
+ setlocal enabledelayedexpansion
5
+
6
+ set "source_dir=E:\tmp\金辉恋曲四重奏\scn"
7
+ set "tool_path=D:\scn\FreeMoteToolkit\PsbDecompile.exe"
8
+ echo %source_dir%
9
+
10
+ for %%f in ("%source_dir%\*.scn") do (
11
+ set "file_path=%%f"
12
+ echo Processing !file_path!
13
+ "%tool_path%" "!file_path!"
14
+ )
15
+
16
+ echo All files processed.
17
+
18
+ endlocal
v-corpus-zh/SAGAPLANETS/金辉恋曲四重奏/FD/金辉恋曲四重奏FD_scn.py ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
39
+ a = get_all_files_in_directory(r'E:\tmp\金辉恋曲四重奏\scn', ext='.txt.json')
40
+ b = r'D:\datasets\tmp'
41
+
42
+ # =================
43
+
44
+ sc = {}
45
+
46
+ _n = {
47
+ "理亚": "理亚",
48
+ "米娜": "米娜",
49
+ "希尔维娅": "希尔维娅",
50
+ "茜": "茜",
51
+ "爱子": "爱子",
52
+ "玲奈": "玲奈",
53
+ "真红": "真红",
54
+ "绚华": "绚华",
55
+ "千惠华": "千惠华",
56
+ "三年级女生A": "三年级女生A",
57
+ "城崎老爷子": "城崎老爷子",
58
+ "艾尔": "艾尔",
59
+ "艾吉斯娜": "艾吉斯娜",
60
+ "千恵华": "千恵华",
61
+ "央路": "央路",
62
+ "3年级女生A": "3年级女生A",
63
+ "店员": "店员",
64
+ "女性店员": "女性店员",
65
+ "6号会员": "6号会员",
66
+ "14号会员": "14号会员",
67
+ "7号会员": "7号会员",
68
+ "3号会员": "3号会员",
69
+ "会员": "会员",
70
+ "你把": "米娜",
71
+ "菊千代": "菊千代",
72
+ "米娜 ": "米娜",
73
+ "//央路": "央路",
74
+ "西乡": "西乡",
75
+ "山本": "山本",
76
+ "希尔维娅・玲奈・艾尔": "希尔维娅&玲奈&艾尔",
77
+ "二年级女子B": "二年级女子B",
78
+ "女学生C": "女学生C",
79
+ "大家": "大家",
80
+ "数学老师": "数学老师",
81
+ "ミ米娜": "米娜",
82
+ "米娜ナ": "米娜",
83
+ "米娜・千惠华": "米娜&千惠华",
84
+ "校医": "校医",
85
+ "AV女优": "AV女优",
86
+ "希尔维娅・玲奈": "希尔维娅&玲奈",
87
+ "艾尔・绚华": "艾尔&绚华",
88
+ "司会": "司会",
89
+ "二年级女生B": "二年级女生B",
90
+ "一年级女生A": "一年级女生A",
91
+ "女生全员": "女生全员",
92
+ "一年级女生C": "一年级女生C",
93
+ "三年级女生C": "三年级女生C",
94
+ "菊千代,西乡,山本": "菊千代&西乡&山本",
95
+ "化学课老师": "化学课老师",
96
+ "丘罗": "丘罗",
97
+ "投良": "投良",
98
+ "千惠华、投良": "千惠华&投良",
99
+ "理亚、玲奈": "理亚&玲奈",
100
+ "偶像声优": "偶像声优",
101
+ "熊孩子A": "熊孩子A",
102
+ "熊孩子B": "熊孩子B",
103
+ "博拉尔考切": "博拉尔考切",
104
+ "玲奈・茜": "玲奈&茜",
105
+ "小市": "小市",
106
+ "绚华、理亚": "绚华&理亚",
107
+ "欺负人的孩子A": "欺负人的孩子A",
108
+ "玲奈、茜": "玲奈&茜",
109
+ "坏心眼女A": "坏心眼女A",
110
+ "咖啡店的阿姨": "咖啡店的阿姨",
111
+ "医生": "医生",
112
+ "院长": "院长",
113
+ "名取": "名取",
114
+ "佣人": "佣人",
115
+ "佣人2": "佣人2",
116
+ "佣人3": "佣人3",
117
+ "佣人们": "佣人们",
118
+ "伊罗艾": "伊罗艾",
119
+ "三年级女生B": "三年级女生B",
120
+ "希尔维娅、玲奈、艾尔": "希尔维娅&玲奈&艾尔",
121
+ "出租车司机": "出租车司机",
122
+ "宿舍的女孩子们": "宿舍的女孩子们",
123
+ "熊孩子A": "熊孩子A",
124
+ "绚华 ": "绚华",
125
+ "制作人": "制作人",
126
+ "4人": "4人",
127
+ "路人1": "路人1",
128
+ "路人2": "路人2",
129
+ "班主任": "班主任",
130
+ "世界史老师": "世界史老师",
131
+ "路人3": "路人3",
132
+ "路人们": "路人们",
133
+ "通行人2": "通行人2",
134
+ "一般男性1": "一般男性1",
135
+ "一般男性2": "一般男性2",
136
+ "小屁孩": "小屁孩",
137
+ "卡车司机": "卡车司机",
138
+ "希尔维": "希尔维",
139
+ "シ希尔维娅": "希尔维娅",
140
+ "观众": "观众",
141
+ "机械声音": "机械声音",
142
+ "3年级女生A": "3年级女生A",
143
+ "1年级女生A": "1年级女生A",
144
+ "2年级女生B": "2年级女生B",
145
+ "女学生C": "女学生C",
146
+ "2年级女性B": "2年级女性B",
147
+ "3年级女性A": "3年级女性A",
148
+ "1年级女性A": "1年级女性A",
149
+ "3年级女生B": "3年级女生B",
150
+ "1年级女生C": "1年级女生C",
151
+ "李阳": "李阳",
152
+ "哎": "哎",
153
+ "会员成员3": "会��成员3",
154
+ "淳二": "淳二",
155
+ "3人": "3人",
156
+ "2人": "2人",
157
+ "鸣泽": "鸣泽",
158
+ "田径部顾问": "田径部顾问",
159
+ " 裁判": "裁判",
160
+ "棒球女子A": "棒球女子A",
161
+ "一年级女生C": "一年级女生C",
162
+ "对方投手": "对方投手",
163
+ "裁判": "裁判",
164
+ "田径部女子": "田径部女子",
165
+ "5人": "5人",
166
+ "路人A": "路人A",
167
+ "路人B": "路人B",
168
+ "2年级女生A": "2年级女生A",
169
+ "黑长直AV女优": "黑长直AV女优",
170
+ "3年女生A": "3年女生A",
171
+ "黑衣人1号": "黑衣人1号",
172
+ "爸爸": "爸爸",
173
+ "2人": "2人",
174
+ "清洁工": "清洁工",
175
+ "理亚の母親": "理亚母亲",
176
+ "医師": "医师",
177
+ "真理亚": "真理亚"
178
+ }
179
+
180
+ # =================
181
+ import json
182
+
183
+ for path in a:
184
+ name = path[path.rindex('\\'):]
185
+ name = '0'
186
+ if name not in sc:
187
+ sc[name] = []
188
+ print(name)
189
+ # =================
190
+
191
+ with open(path, 'r', encoding='utf-8') as json_file:
192
+ data = json.load(json_file)
193
+
194
+ # =================
195
+ for texts in data['scenes']:
196
+ try:
197
+ for texts in texts['texts']:
198
+ # print(texts)
199
+ n = texts[0]
200
+ if n is None:
201
+ n = '旁白'
202
+ else:
203
+ if n in _n:
204
+ n = _n[n]
205
+ else:
206
+ _n[n] = clearT(n).replace('・', '&')
207
+ print(texts, n)
208
+
209
+ # =================
210
+ d = clearT(texts[2])
211
+ if d:
212
+ sc[name].append(n + ':' + d)
213
+
214
+ except KeyError:
215
+ if type(texts) is not dict:
216
+ print(texts)
217
+
218
+ # =================
219
+
220
+ for k, v in sc.items():
221
+ if v:
222
+ with open(b + f'\\{k}.txt', 'w', encoding='utf-8') as f:
223
+ f.write('\n'.join(v))
224
+
225
+ # =================
226
+ import json
227
+ tmp = json.dumps(_n, ensure_ascii=False, indent=4)