Datasets:

Languages:
Chinese
Tags:
Not-For-All-Audiences
License:
Limour commited on
Commit
9585c59
·
verified ·
1 Parent(s): d87c386

Upload 6 files

Browse files
v-corpus-zh/KAI-SOFT/青空下的加缪/bsc10.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c6fd26b3b6096d1cdaf14df82a00b4406eb7c7e09ad15f21049187f5a2bfa0a4
3
+ size 83131
v-corpus-zh/KAI-SOFT/青空下的加缪/bsc15.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d718e8bb103bd2af8ed4b41813d36d7e4b11080e065914e53df23feb3cd48e6
3
+ size 5916
v-corpus-zh/KAI-SOFT/青空下的加缪/bsc20.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19657360dc0c41b5f0e14c9fa0211eec70af76f6ae659a4215a48aed5729cded
3
+ size 110957
v-corpus-zh/KAI-SOFT/青空下的加缪/bsc30.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aaa743e9a4d3ed3e56c36fb73dd6cb684f6e82c7f54d3cb423072c345e0d9c2d
3
+ size 45638
v-corpus-zh/KAI-SOFT/青空下的加缪/bsc_g.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:824de523865455c036cc45138491e7a4301bf87fa53822944305043eb25f6d9c
3
+ size 19480
v-corpus-zh/KAI-SOFT/青空下的加缪/tmp_qkxdjm.py ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import os
3
+ import re
4
+ import unicodedata
5
+ from opencc import OpenCC
6
+
7
+
8
+ def full2half(input_str):
9
+ return ''.join([unicodedata.normalize('NFKC', char) for char in input_str])
10
+
11
+
12
+ cc = OpenCC('t2s') # 't2s'表示繁体转简体
13
+
14
+
15
+ def clearT(s):
16
+ s = cc.convert(full2half(s))
17
+ return s.lstrip('n').strip().strip(r'\n').replace('\n', '\\n')
18
+
19
+
20
+ custom_sort_key_re = re.compile('([0-9]+)')
21
+
22
+
23
+ def custom_sort_key(s):
24
+ # 将字符串中的数字部分转换为整数,然后进行排序
25
+ return [int(x) if x.isdigit() else x for x in custom_sort_key_re.split(s)]
26
+
27
+
28
+ def get_all_files_in_directory(directory, ext=''):
29
+ all_files = []
30
+ for root, dirs, files in os.walk(directory):
31
+ for file in files:
32
+ if file.endswith(ext):
33
+ file_path = os.path.join(root, file)
34
+ all_files.append(file_path)
35
+ return sorted(all_files, key=lambda x: custom_sort_key(x))
36
+
37
+
38
+ a = get_all_files_in_directory(r'E:\tmp\qk\json', ext='.txt.json')
39
+
40
+ _n = {
41
+ "": "旁白",
42
+ "燐": "燐",
43
+ "萤": "萤",
44
+ "车内广播": "广播",
45
+ "何農夫": "何农夫",
46
+ "なにかA": "怪A", # 村民变成的怪物
47
+ "なにかB": "怪B",
48
+ "何若者": "何若者",
49
+ "声音": "声音",
50
+ "サトくん": "佐藤君", # 缠着绷带的白狗
51
+ "聪君": "聪君", # 缠着绷带的白狗
52
+ "なにかC": "怪C",
53
+ "ヒヒ": "狒狒", # 追赶燐和蛍的高大狒狒怪物
54
+ "群がるなにかA": "群怪A",
55
+ "群がるなにかB": "群怪B",
56
+ "群がるなにかC": "群怪C",
57
+ "小さいオオモト様": "小小的大本大人", # 三间坂家的座敷童
58
+ "群がるなにかD": "群怪D",
59
+ "蛍": "萤",
60
+ "群がるなにかE": "群怪E",
61
+ "群がるなにかF": "群怪F",
62
+ "群がるなにかG": "群怪G",
63
+ "繰り返すなにかA": "重复的怪A",
64
+ "繰り返すなにかB": "重复的怪B",
65
+ "繰り返すなにかC": "重复的怪C",
66
+ "繰り返すなにかD": "重复的怪D",
67
+ "繰り返すなにかE": "重复的怪E",
68
+ "繰り返すなにかF": "重复的怪F",
69
+ "大人のオオモト様": "成年的大本大人", # ?
70
+ "しつこいなにかC": "顽固的怪C",
71
+ "しつこいなにかA": "顽固的怪A",
72
+ "しつこいなにかB": "顽固的怪B",
73
+ "系着领带的人影": "系着领带的人影",
74
+ "何教師": "何教师",
75
+ "聪": "聪",
76
+ "何警官": "何警官",
77
+ "DJゴドー": "DJ戈多",
78
+ "DJ戈多": "DJ戈多",
79
+ "何作業": "何作业",
80
+ "人形": "人形",
81
+ "人偶": "人偶",
82
+ "狒狒": "狒狒",
83
+ "影のようななにかA": "影怪A", # 像影子一样的怪A
84
+ "影のようななにかB": "影怪B",
85
+ "影のようななにかC": "影怪C",
86
+ "燐的母亲": "燐的母亲",
87
+ "孩子们": "孩子们",
88
+ "小孩子": "小孩子",
89
+ "小孩子的母亲": "小孩子的母亲",
90
+ "少女": "少女",
91
+ "吉村": "吉村",
92
+ "大川": "大川",
93
+ "小小的大本大人": "小小的大本大人",
94
+ "打着波洛领带的人影": "打着波洛领带的人影"
95
+ }
96
+
97
+ b = r'D:\datasets\tmp'
98
+ sc = {}
99
+
100
+ for path in a:
101
+ tmp = path.split('\\')[-1][:5]
102
+ name = tmp
103
+ if name not in sc:
104
+ sc[name] = []
105
+ print(name)
106
+ with open(path, 'r', encoding='utf-8') as json_file:
107
+ data = json.load(json_file)
108
+
109
+ for texts in data['scenes']:
110
+ try:
111
+ for texts in texts['texts']:
112
+ # print(texts)
113
+ n = texts[0]
114
+ # _n[n] = n
115
+ n = _n[n]
116
+ d = clearT(texts[2])
117
+ if d:
118
+ sc[name].append(n + ':' + d)
119
+ pass
120
+ except KeyError:
121
+ if type(texts) is not dict:
122
+ print(texts)
123
+
124
+ for k, v in sc.items():
125
+ with open(b + f'\\{k}.txt', 'w', encoding='utf-8') as f:
126
+ f.write('\n'.join(v))
127
+
128
+ tmp = json.dumps(_n, ensure_ascii=False, indent=2)