Upload 3 files
Browse files
v-corpus-zh/Satsuki/从Kiss开始的自我主义~EGOISM/kiss.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:eb2581a19e12dcc574eb0ab60d44b5f5aa6321e5248b11ecffbd6ef56ba29c7a
|
3 |
+
size 115687
|
v-corpus-zh/Satsuki/从Kiss开始的自我主义~EGOISM/scn2json.bat
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@echo off
|
2 |
+
setlocal enabledelayedexpansion
|
3 |
+
|
4 |
+
set "source_dir=\\tsclient\E\tmp\kiss\scn"
|
5 |
+
set "tool_path=D:\app\FreeMoteToolkit\PsbDecompile.exe"
|
6 |
+
|
7 |
+
for %%f in ("%source_dir%\*.scn") do (
|
8 |
+
set "file_path=%%f"
|
9 |
+
echo Processing !file_path!
|
10 |
+
"%tool_path%" "!file_path!"
|
11 |
+
)
|
12 |
+
|
13 |
+
echo All files processed.
|
14 |
+
|
15 |
+
endlocal
|
v-corpus-zh/Satsuki/从Kiss开始的自我主义~EGOISM/tmp_kiss.py
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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\kiss\ks', ext='.txt.json')
|
24 |
+
|
25 |
+
_n = {
|
26 |
+
"創": "创",
|
27 |
+
"null": '旁白',
|
28 |
+
None: '旁白',
|
29 |
+
"テレビ": "电视的声音",
|
30 |
+
"エゴ": "EGO",
|
31 |
+
"スカウト": "星探",
|
32 |
+
"女客A": "女客人",
|
33 |
+
"先輩ホスト": "牛郎前辈",
|
34 |
+
"女客B": "女客人",
|
35 |
+
"オーナー": "老板",
|
36 |
+
"ゴロー": "GORO",
|
37 |
+
"おばちゃん": "老婆婆",
|
38 |
+
"フレンチブルドッグ": "法国斗牛犬",
|
39 |
+
"運転手": "司机",
|
40 |
+
"浅倉": "浅仓",
|
41 |
+
"レンタカー店員": "租车行店员",
|
42 |
+
"ナンパ女A": "搭讪女A",
|
43 |
+
"ナンパ女B": "搭讪女B",
|
44 |
+
"ホテル店員": "饭店柜台人员",
|
45 |
+
"ストーカー": "跟踪狂",
|
46 |
+
"博士": "博士",
|
47 |
+
"配達員": "送货员"
|
48 |
+
}
|
49 |
+
|
50 |
+
b = r'D:\datasets\tmp'
|
51 |
+
sc = {}
|
52 |
+
|
53 |
+
for path in a:
|
54 |
+
name = 'kiss'
|
55 |
+
if name not in sc:
|
56 |
+
sc[name] = []
|
57 |
+
print(name)
|
58 |
+
with open(path, 'r', encoding='utf-8') as json_file:
|
59 |
+
data = json.load(json_file)
|
60 |
+
|
61 |
+
for texts in data['scenes']:
|
62 |
+
try:
|
63 |
+
for texts in texts['texts']:
|
64 |
+
# print(texts)
|
65 |
+
n = texts[0]
|
66 |
+
# _n[n] = texts[1][2][0]
|
67 |
+
n = _n[n]
|
68 |
+
d = texts[1][2][1]
|
69 |
+
if d:
|
70 |
+
sc[name].append(n + ':' + d)
|
71 |
+
except KeyError:
|
72 |
+
if type(texts) is not dict:
|
73 |
+
print(texts)
|
74 |
+
|
75 |
+
for k, v in sc.items():
|
76 |
+
with open(b + f'\\{k}.txt', 'w', encoding='utf-8') as f:
|
77 |
+
f.write('\n'.join(v))
|
78 |
+
|
79 |
+
tmp = json.dumps(_n, ensure_ascii=False, indent=2)
|