Upload 4 files
Browse files
v-corpus-zh/FrontWing/GINKA/0.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:35b0048881cca7048aac5f58e8ee5fb8462003f79029ef3ed9f60f3b86f893da
|
3 |
+
size 195843
|
v-corpus-zh/FrontWing/GINKA/1.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c2b8bc4b51a2886a6a985d25df4377e18e8f7d4407bb5b942bb5ae745822ce9f
|
3 |
+
size 138584
|
v-corpus-zh/FrontWing/GINKA/9.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b1234cfcfd6f3acca807db3bceddca6cd8a5296e672159edb387a3fae804666f
|
3 |
+
size 2730
|
v-corpus-zh/FrontWing/GINKA/tmp_ginka.py
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
import os
|
3 |
+
import re
|
4 |
+
|
5 |
+
custom_sort_key_re = re.compile('([0-9]+)')
|
6 |
+
|
7 |
+
|
8 |
+
def custom_sort_key(s):
|
9 |
+
# 将字符串中的数字部分转换为整数,然后进行排序
|
10 |
+
return [int(x) if x.isdigit() else x for x in custom_sort_key_re.split(s)]
|
11 |
+
|
12 |
+
|
13 |
+
def get_all_files_in_directory(directory, ext=''):
|
14 |
+
all_files = []
|
15 |
+
for root, dirs, files in os.walk(directory):
|
16 |
+
for file in files:
|
17 |
+
if file.endswith(ext):
|
18 |
+
file_path = os.path.join(root, file)
|
19 |
+
all_files.append(file_path)
|
20 |
+
return sorted(all_files, key=lambda x: custom_sort_key(x))
|
21 |
+
|
22 |
+
|
23 |
+
a = get_all_files_in_directory(r'E:\tmp\GINKA', ext='.ks.json')
|
24 |
+
|
25 |
+
_n = {
|
26 |
+
"流星": "流星",
|
27 |
+
None: '旁白',
|
28 |
+
"銀花": "银花",
|
29 |
+
"アナウンス": "广播",
|
30 |
+
"ひまわり": "阳葵",
|
31 |
+
"ゴン太": "权太",
|
32 |
+
"ギンカ": "Ginka",
|
33 |
+
"先生": "老师",
|
34 |
+
"リン": "凛",
|
35 |
+
"ウメ": "梅",
|
36 |
+
"子どもA": "儿童A",
|
37 |
+
"子どもB": "儿童B",
|
38 |
+
"ポメラニアン": "博美犬",
|
39 |
+
"婆さん": "老婆婆",
|
40 |
+
"草二": "草二",
|
41 |
+
"子どもC": "儿童C",
|
42 |
+
"かき氷屋さん": "刨冰摊老板",
|
43 |
+
"あんず": "杏子",
|
44 |
+
"子どもD": "儿童D",
|
45 |
+
"テレビ": "TV",
|
46 |
+
"ギンカ・ひまわり": "Ginka&阳葵",
|
47 |
+
"ハナ": "花",
|
48 |
+
"クラスメイトA": "同学A",
|
49 |
+
"流星・先生・ひまわり": "流星&阳葵&老师",
|
50 |
+
"担任教師": "班主任",
|
51 |
+
"花憐": "花怜",
|
52 |
+
"ギンカ・銀花": "Ginka&银花",
|
53 |
+
"豆腐屋の次男坊": "豆腐店家的二儿子",
|
54 |
+
"防災放送": "防灾广播",
|
55 |
+
"リンの祖母": "凛的祖母",
|
56 |
+
"ハナの弟": "花的弟弟",
|
57 |
+
"島の男": "岛民",
|
58 |
+
"同級生の女子": "女同学",
|
59 |
+
"大人の男性": "成年男性",
|
60 |
+
"流星・銀花": "流星&银花"
|
61 |
+
}
|
62 |
+
|
63 |
+
b = r'D:\datasets\tmp'
|
64 |
+
sc = {}
|
65 |
+
|
66 |
+
for path in a:
|
67 |
+
tmp = path.split('scn')
|
68 |
+
name = tmp[-1][0]
|
69 |
+
if name not in sc:
|
70 |
+
sc[name] = []
|
71 |
+
print(name)
|
72 |
+
with open(path, 'r', encoding='utf-8') as json_file:
|
73 |
+
data = json.load(json_file)
|
74 |
+
|
75 |
+
for texts in data['scenes']:
|
76 |
+
try:
|
77 |
+
for texts in texts['texts']:
|
78 |
+
# print(texts)
|
79 |
+
n = texts[0]
|
80 |
+
# _n[n] = texts[1][2][0]
|
81 |
+
n = _n[n]
|
82 |
+
d = texts[1][2][1]
|
83 |
+
if '\n' in d:
|
84 |
+
print(d)
|
85 |
+
if d:
|
86 |
+
sc[name].append(n + ':' + d)
|
87 |
+
pass
|
88 |
+
except KeyError:
|
89 |
+
if type(texts) is not dict:
|
90 |
+
print(texts)
|
91 |
+
|
92 |
+
for k, v in sc.items():
|
93 |
+
with open(b + f'\\{k}.txt', 'w', encoding='utf-8') as f:
|
94 |
+
f.write('\n'.join(v))
|
95 |
+
|
96 |
+
tmp = json.dumps(_n, ensure_ascii=False, indent=2)
|