Datasets:

Languages:
Chinese
Tags:
Not-For-All-Audiences
License:
Limour commited on
Commit
7564eb0
·
verified ·
1 Parent(s): 28621a3

Upload 6 files

Browse files
v-corpus-zh/PurpleSoftware/久那土国记/sce.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d55776bbb5a4cb924e696a15db76ab8ff4709acc9f0a809f3ae764fe6248934
3
+ size 68025
v-corpus-zh/PurpleSoftware/久那土国记/sn1.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ddb4a179d2573f06d5945bf41ac76bd950e0a40f5a94a838e1ca0ba33dfd0896
3
+ size 653323
v-corpus-zh/PurpleSoftware/久那土国记/sn2.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae620124cd6bebe752420aada57e30f1a8b8b61e7c2c0d69612d82fd8fa5bca4
3
+ size 68432
v-corpus-zh/PurpleSoftware/久那土国记/sn3.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19685110faa3c317241f4b5cc48bb774b415609781728f7d9764a8cdeb19189f
3
+ size 85922
v-corpus-zh/PurpleSoftware/久那土国记/sn7.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ce29eba6b3c068878147841d76ec535d669c337c71e06f953a764dd810538ea2
3
+ size 78327
v-corpus-zh/PurpleSoftware/久那土国记/久那土国记_tjs.py ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import sys
2
+ sys.path.append('..')
3
+
4
+ from common import \
5
+ get_all_files_in_directory, \
6
+ getCmdArgsMap, clearT
7
+ # https://huggingface.co/datasets/Limour/archvie/blob/main/v-corpus-zh/common.py
8
+
9
+ # =================
10
+
11
+ a = get_all_files_in_directory(r'F:\galgame\久那土国记\ks\scenario\main', ext='.ks')
12
+ b = r'F:\galgame\久那土国记\text'
13
+
14
+ # =================
15
+
16
+ sc = {}
17
+ _n = {
18
+ "name_none" : "旁白",
19
+ "name_question" : "?",
20
+ "name_haru" : "春姬",
21
+ "name_natsu" : "夏姬",
22
+ "name_yuri" : "优里",
23
+ "name_akane" : "茜",
24
+ "name_aoi" : "葵",
25
+ "name_shiki" : "识",
26
+ "name_some" : "染",
27
+ "name_tsubame" : "燕",
28
+ "name_shin" : "信",
29
+ "name_huyu" : "冬人",
30
+ "name_kozima" : "小岛",
31
+ "name_hana" : "一花",
32
+ "name_cat" : "猫",
33
+ "name_bcat" : "黑猫",
34
+ "name_tekki" : "铁鬼",
35
+ "name_kamen" : "狐面",
36
+ "name_kamen1" : "狐面1",
37
+ "name_kamen2" : "狐面2",
38
+ "name_kamen3" : "狐面3",
39
+ "name_kamen4" : "狐面4",
40
+ "name_you" : "YOU",
41
+ "name_all" : "众人",
42
+ "name_haru_akane" : "春姬&茜",
43
+ "name_haru_huyu" : "春姬&冬人",
44
+ "name_akane_aoi" : "茜&葵",
45
+ "name_aoi_huyu" : "葵&冬人",
46
+ "name_aoi_tsubame" : "葵&燕",
47
+ "name_shin_natsu" : "信&夏姬",
48
+ "name_shin_haru" : "信&春姬",
49
+ "name_shin_aoi" : "信&葵",
50
+ "name_haru_aoi_yuri" : "春姬&葵&优里",
51
+ "name_shin_akane_aoi" : "信&茜&葵",
52
+ "name_shin_haru_yuri" : "信&春姬&优里",
53
+ }
54
+ # =================
55
+ langMap = {}
56
+ import re
57
+ re_map = re.compile(r'"(.+)"\s*=>\s*"(.+)"\s*,')
58
+ c = get_all_files_in_directory(r'F:\galgame\久那土国记\tjs\lang\lang_zhcn', ext='.tjs')
59
+ for path in c:
60
+ with open(path, 'r', encoding='utf-8') as f:
61
+ for line in f:
62
+ tmp = re_map.findall(line)
63
+ # [('48205', '她们身为女性的部分,逐渐在觉醒。')]
64
+ if not tmp:
65
+ continue
66
+ assert len(tmp) == 1
67
+ tmp = tmp[0]
68
+ langMap[tmp[0]] = tmp[1]
69
+
70
+
71
+ # =================
72
+
73
+ for path in a:
74
+ name: str = path[path.rindex('\\') + 1:]
75
+ name = name[:3]
76
+ if name not in sc:
77
+ sc[name] = []
78
+ print(name)
79
+
80
+ # =================
81
+ try:
82
+ f = open(path, 'r', encoding='utf-8')
83
+ data = list(x.rstrip() for x in f.readlines())
84
+ except UnicodeDecodeError:
85
+ f = open(path, 'r', encoding='utf-16-le')
86
+ data = list(x.rstrip() for x in f.readlines())
87
+ finally:
88
+ f.close()
89
+
90
+ # =================
91
+ data[0] = data[0].lstrip('\ufeff')
92
+ # print(data[0][0])
93
+ def _filter(x: str):
94
+ if not x:
95
+ return False
96
+ if x.startswith(';'):
97
+ return False
98
+ return True
99
+ data = list(filter(_filter, data))
100
+
101
+ # =================
102
+ w_i = -1
103
+ while w_i < len(data) - 1:
104
+ w_i += 1
105
+ line: str = data[w_i]
106
+ # =================
107
+ if not line.startswith('@api_message_code_out'):
108
+ continue
109
+ tmp = getCmdArgsMap(line)
110
+ mes_no = tmp['mes_no']
111
+ n = tmp['name_no']
112
+ if n in _n:
113
+ n = _n[n]
114
+ else:
115
+ _n[n] = n
116
+ print(line)
117
+ d = clearT(langMap[mes_no])
118
+ if d:
119
+ sc[name].append(n + ':' + d)
120
+
121
+ # =================
122
+ for k, v in sc.items():
123
+ if v:
124
+ with open(b + f'\\{k}.txt', 'w', encoding='utf-8') as f:
125
+ f.write('\n'.join(v))