Datasets:

Languages:
Chinese
Tags:
Not-For-All-Audiences
License:
Limour commited on
Commit
0da991e
·
verified ·
1 Parent(s): 010d339

玉响未来

Browse files
v-corpus-zh/Azurite/玉响未来/0.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:efa183e931f5b878e5756c13b74312ec808c3cfcf6d91dc5baf3e6bd46103f10
3
+ size 198884
v-corpus-zh/Azurite/玉响未来/a.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5758d4f2abd14189cd78646050edf843bb88a0988819eeb96b5a6a7c3766902c
3
+ size 194811
v-corpus-zh/Azurite/玉响未来/b.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2f7f742f694e903b6b781e9cbbdfad4365b9752155c061d872763341def55c85
3
+ size 156100
v-corpus-zh/Azurite/玉响未来/c.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3153e37018f430b197f357d7c5dd48bfce95ce34200efa32ea2741ab7cba3ad5
3
+ size 147897
v-corpus-zh/Azurite/玉响未来/d.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1242b3be48a23940009c8271aba254cc4d226ed33117bb76ef286d3af3fd542e
3
+ size 144689
v-corpus-zh/Azurite/玉响未来/玉响未来_scn.py ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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='.txt.json')
41
+ b = r'E:\tmp\玉响未来_\text'
42
+
43
+ # =================
44
+
45
+ # =================
46
+
47
+ sc = {}
48
+
49
+ _n = {
50
+ "睦季": "睦季",
51
+ "白": "白",
52
+ "由岐奈": "由岐奈",
53
+ "美陀璃": "美陀璃",
54
+ "保安": "保安",
55
+ "花子": "花子",
56
+ "红河童": "红河童",
57
+ "另一种红河童": "另一种红河童",
58
+ "其他红河童": "其他红河童",
59
+ "蒔奈": "莳奈",
60
+ "人狼": "人狼",
61
+ "莳奈": "莳奈",
62
+ "猿妖": "猿妖",
63
+ "フェレス": "玩偶",
64
+ "女学生": "女学生",
65
+ "六神石的妖异": "六神石的妖异",
66
+ "其他妖异": "其他妖异",
67
+ "六神石妖异": "六神石妖异",
68
+ "古树": "古树",
69
+ "旁边的古树": "旁边的古树",
70
+ "更旁边的古树": "更旁边的古树",
71
+ "大樹": "大树",
72
+ "权现大人": "权现大人",
73
+ "マダム・リュスト": "信",
74
+ "男学生": "男学生",
75
+ "龙胆": "龙胆",
76
+ "槌渊的狮子": "槌渊的狮子",
77
+ "村民": "村民",
78
+ "老女": "老女",
79
+ "乳母": "乳母",
80
+ "乌鸦妖异": "乌鸦妖异",
81
+ "狐狸妖异": "狐狸妖异",
82
+ "水妖": "水妖",
83
+ "其他水妖": "其他水妖",
84
+ "山中妖异": "山中妖异",
85
+ "みだり": "声音",
86
+ "倾谈者": "倾谈者",
87
+ "オシラサマ": "御白大人",
88
+ "留斯特夫人": "留斯特夫人",
89
+ "玛丽安娜": "玛丽安娜",
90
+ "红": "红",
91
+ "菲蕾丝": "菲蕾丝",
92
+ "幼年红河童": "幼年红河童",
93
+ "二人": "二人",
94
+ "岩神": "岩神",
95
+ "罗汉大神": "罗汉大神",
96
+ "其他罗汉大神": "其他罗汉大神",
97
+ "枥曲": "枥曲",
98
+ "枥曲之女": "枥曲之女",
99
+ "枥曲灵树": "枥曲灵树",
100
+ "山姥": "山姥",
101
+ "班主任": "班主任",
102
+ "班同学": "班同学",
103
+ "「说是突然跑出一只大猴子,好危险的ー」": "女性的声音",
104
+ "广纪": "广纪",
105
+ "千寻": "千寻",
106
+ "广纪&千寻": "广纪&千寻",
107
+ "「睦季哥哥让我们赶紧回来」": "广纪的声音",
108
+ "但是,站在门口的却是那些孩子们。": "千寻的声音",
109
+ "紅": "红",
110
+ "老生老气的声音": "老生老气的声音",
111
+ "女性的声音": "女性的声音",
112
+ "其他女性的声音": "其他女性的声音",
113
+ "ヤマウバ": "山姥的声音",
114
+ "月亮大人": "月亮大人",
115
+ "蛇哥哥": "蛇哥哥",
116
+ "蛇弟弟": "蛇弟弟",
117
+ "妻子锅": "妻子锅",
118
+ "污秽者": "污秽者",
119
+ "手紙": "手纸",
120
+ "「这就叫姜还是老的辣啊」": "白&美陀璃",
121
+ "警備員": "警备员",
122
+ "穢れた者": "雄釜",
123
+ "班同学女子A": "班同学女子A",
124
+ "担任": "担任",
125
+ "女学生A": "女学生A",
126
+ "女学生B": "女学生B",
127
+ "女学生C": "女学生C",
128
+ "红河童们": "红河童们",
129
+ "班同学女子B": "班同学女子B",
130
+ "班同学女子C": "班同学女子C",
131
+ "由岐奈&莳奈": "由岐奈&莳奈",
132
+ "猫川の妖異長": "猫川妖异长",
133
+ "猫川妖异长": "猫川妖异长",
134
+ "猫川妖异A": "猫川妖异A",
135
+ "猫川妖异B": "猫川妖异B",
136
+ "「怎、怎么会……! 水虎大人、水虎大人……!」": "猫川妖异A&B",
137
+ "鲤鱼奶奶": "鲤鱼奶奶",
138
+ "一代": "一代",
139
+ "ウスノロ": "傻大个",
140
+ "妖異": "妖异"
141
+ }
142
+
143
+ # =================
144
+ import json
145
+
146
+ for path in a:
147
+ name = path[path.rindex('\\'):]
148
+ name = name[14]
149
+ if name not in sc:
150
+ sc[name] = []
151
+ print(name)
152
+ # =================
153
+
154
+ with open(path, 'r', encoding='utf-8') as json_file:
155
+ data = json.load(json_file)
156
+
157
+ # =================
158
+ for texts in data['scenes']:
159
+ try:
160
+ for texts in texts['texts']:
161
+ # print(texts)
162
+ n = texts[0]
163
+ if not n:
164
+ n = '旁白'
165
+ else:
166
+ if n in _n:
167
+ n = _n[n]
168
+ else:
169
+ _n[n] = clearT(n).replace('・', '&')
170
+ print(texts, n)
171
+
172
+ # =================
173
+ d = clearT(texts[2])
174
+ if d:
175
+ sc[name].append(n + ':' + d)
176
+
177
+ except KeyError:
178
+ if type(texts) is not dict:
179
+ print(texts)
180
+
181
+ # =================
182
+
183
+ for k, v in sc.items():
184
+ if v:
185
+ with open(b + f'\\{k}.txt', 'w', encoding='utf-8') as f:
186
+ f.write('\n'.join(v))
187
+
188
+ # =================
189
+ import json
190
+ tmp = json.dumps(_n, ensure_ascii=False, indent=4)