Upload 21 files
Browse files- 视觉小说/format/KAMIKIMIEX/s00.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/s01.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/s02.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/s03.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/s04.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/s05.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/s06.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/s07.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/s08.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/s09.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/s11.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/s12.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/s13.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/sa0.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/sb0.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/sc0.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/sd0.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/se0.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/sf0.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/si0.txt.gz +3 -0
- 视觉小说/format/KAMIKIMIEX/tmp-KAMIKIMIEX.py +163 -0
视觉小说/format/KAMIKIMIEX/s00.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:729314bd73626ee8882d94a1f20a4009cbf6ce390a31456194dd0e0921c70302
|
3 |
+
size 8053
|
视觉小说/format/KAMIKIMIEX/s01.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:52dfc070995b749bd2b0bacbe30585ac93b5fa822bc8e58a5d92bf8ec69fbc71
|
3 |
+
size 21143
|
视觉小说/format/KAMIKIMIEX/s02.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:72852291f46b357494736e7093c5f9c52bb7e77cb1a9c34d557d024a5dce574e
|
3 |
+
size 17081
|
视觉小说/format/KAMIKIMIEX/s03.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9f3c71b0633145d3047ce9352633832d20b23f8f77b3ace9d058bb315d19977e
|
3 |
+
size 35676
|
视觉小说/format/KAMIKIMIEX/s04.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fabc69c47f62677a4a06d73307c3a5a2cc3d721ea663ea4ff7d03ffe1964582a
|
3 |
+
size 25430
|
视觉小说/format/KAMIKIMIEX/s05.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:34b22042060a5b77fb87a05847445b783acd60b3caaf7fbe5f5f944201db99fa
|
3 |
+
size 16757
|
视觉小说/format/KAMIKIMIEX/s06.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e248b2209afe3ed567fc7d104e391c022acfbb02bd8000d1b82a0462ed47b867
|
3 |
+
size 16334
|
视觉小说/format/KAMIKIMIEX/s07.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f76831f7a460c1d8607fdd84fb8c3cd62a96e63448c0e56aeaa6d81fe7ad5f40
|
3 |
+
size 11878
|
视觉小说/format/KAMIKIMIEX/s08.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0958771510f1725377aa50621a0435aa80c8eafb0cd3673cdedc1e88920354b8
|
3 |
+
size 15932
|
视觉小说/format/KAMIKIMIEX/s09.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:18dd9be372a45a3a5135ae854bd75208cb839dc873c95053ba0ca73acbff0707
|
3 |
+
size 12629
|
视觉小说/format/KAMIKIMIEX/s11.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:61bfedc88bad80fca78ce8870bdfdf5e5b05982081b58220cc1c4ef38491c00c
|
3 |
+
size 6198
|
视觉小说/format/KAMIKIMIEX/s12.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:244540fba7b93c2056afee8f3dd62822641349917237dadc6067bd0f4696b237
|
3 |
+
size 4357
|
视觉小说/format/KAMIKIMIEX/s13.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a2098669106590b18155c910d8d713d643fa51f0ade505c33d2e2379e4d7f901
|
3 |
+
size 13506
|
视觉小说/format/KAMIKIMIEX/sa0.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:19b7f1b2f2d1e30699312de84d8a5e9a1e378f66454be08c5753f2e44c9d4b75
|
3 |
+
size 139571
|
视觉小说/format/KAMIKIMIEX/sb0.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:768784ff0035f4641d8f950f0f4ae81f48592ec1697f6e482c42961352d6bfec
|
3 |
+
size 143062
|
视觉小说/format/KAMIKIMIEX/sc0.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e131eceec7ed8f3029afd0180b2977c922a51ffe9d1bf83b937ec29adf63db25
|
3 |
+
size 155410
|
视觉小说/format/KAMIKIMIEX/sd0.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:25e761ac280b7ca6218d649818f1aa6ae19f034bfbed487b35836575e7bc0390
|
3 |
+
size 93439
|
视觉小说/format/KAMIKIMIEX/se0.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e900d5a641f6c1061c96a5badbe34c3029bdceb6f2e2a0cbf141795aa28c5284
|
3 |
+
size 74218
|
视觉小说/format/KAMIKIMIEX/sf0.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ec2adaf573030537d2d5a5d843a1aeba29c550bc5817d47e764694db3c3df0b5
|
3 |
+
size 90650
|
视觉小说/format/KAMIKIMIEX/si0.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:615d9189dc4854244db38ad43be6bbed6c819178c4fdb79e4e09bb3caf38e8fa
|
3 |
+
size 95796
|
视觉小说/format/KAMIKIMIEX/tmp-KAMIKIMIEX.py
ADDED
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from opencc import OpenCC
|
2 |
+
cc = OpenCC('t2s') # 't2s'表示繁体转简体
|
3 |
+
from h_corpus import Fileset
|
4 |
+
import unicodedata
|
5 |
+
import re
|
6 |
+
import json
|
7 |
+
def fullwidth_to_halfwidth(input_str):
|
8 |
+
return ''.join([unicodedata.normalize('NFKC', char) for char in input_str])
|
9 |
+
|
10 |
+
def clearT(s):
|
11 |
+
s = cc.convert(fullwidth_to_halfwidth(s))
|
12 |
+
return s.strip()
|
13 |
+
|
14 |
+
def safe_index(s, _s, _i):
|
15 |
+
try:
|
16 |
+
retn = s.index(_s, _i)
|
17 |
+
except:
|
18 |
+
return 0, ''
|
19 |
+
return retn+1, s[_i:retn]
|
20 |
+
|
21 |
+
def get_p(s, sep=' ', _max=4):
|
22 |
+
retn = []
|
23 |
+
idx = 0
|
24 |
+
for i in range(_max):
|
25 |
+
idx, tmp = safe_index(s, sep, idx)
|
26 |
+
if idx == 0:
|
27 |
+
break
|
28 |
+
retn.append(tmp)
|
29 |
+
retn.append(s[idx:])
|
30 |
+
return retn
|
31 |
+
|
32 |
+
a = Fileset(r'D:\datasets\tmp', ext='.ks')
|
33 |
+
b = r'D:\datasets\b-corpus\KAMIKIMIEX'
|
34 |
+
in_talk = False
|
35 |
+
_n = {
|
36 |
+
"???": "?",
|
37 |
+
"心の声": "旁白",
|
38 |
+
"块斗": "块斗",
|
39 |
+
"C‐AI": "C-AI",
|
40 |
+
"月咏": "月咏",
|
41 |
+
"雾香": "雾香",
|
42 |
+
"喧哗的女生": "喧哗的女生",
|
43 |
+
"爱凑热闹的女生": "爱凑热闹的女生",
|
44 |
+
"帅气的男生": "帅气的男生",
|
45 |
+
"拉娜": "拉娜",
|
46 |
+
"值日生的山本": "值日生的山本",
|
47 |
+
"目出岛": "目出岛",
|
48 |
+
"塊斗": "块斗",
|
49 |
+
"安保系统": "安保系统",
|
50 |
+
"叶月": "叶月",
|
51 |
+
"老师": "老师",
|
52 |
+
"OldMan": "OldMan",
|
53 |
+
"索菲娅": "索菲娅",
|
54 |
+
"玲音": "玲音",
|
55 |
+
"爱彩梨": "爱彩梨",
|
56 |
+
"高个子的男生": "高个子的男生",
|
57 |
+
"松冈": "松冈",
|
58 |
+
"霧香": "雾香",
|
59 |
+
"伊澄博士": "伊澄博士",
|
60 |
+
"记者": "记者",
|
61 |
+
"喜欢八卦的女生": "喜欢八卦的女生",
|
62 |
+
"不受欢迎的男生": "不受欢迎的男生",
|
63 |
+
"新闻部的男生": "新闻部的男生",
|
64 |
+
"新闻部部长": "新闻部部长",
|
65 |
+
"月咏1": "月咏1",
|
66 |
+
"月咏2": "月咏2",
|
67 |
+
"月咏3": "月咏3",
|
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 |
+
"AI": "AI",
|
103 |
+
"流浪仓鼠": "流浪仓鼠",
|
104 |
+
"爱爱凑热闹的女生": "爱爱凑热闹的女生",
|
105 |
+
"ツクヨミ": "ツクヨミ", # 月咏 先不改,便于定位后进行全文翻译
|
106 |
+
"黄毛小混混": "黄毛小混混",
|
107 |
+
"纹身小混混": "纹身小混混",
|
108 |
+
"金发小混混": "金发小混混",
|
109 |
+
"冬守": "冬守",
|
110 |
+
"梦山": "梦山",
|
111 |
+
"强壮的保安": "强壮的保安",
|
112 |
+
"高个子保安": "高个子保安",
|
113 |
+
"强悍的保安": "强悍的保安",
|
114 |
+
"海枝所长": "海枝所长",
|
115 |
+
"女新闻主持人": "女新闻主持人",
|
116 |
+
"男新闻主持人": "男新闻主持人"
|
117 |
+
}
|
118 |
+
reg_name = re.compile(r' name=(.+?)($| )')
|
119 |
+
reg_cs = re.compile(r' text=(.+?)($| )')
|
120 |
+
d_s = []
|
121 |
+
idx = 0
|
122 |
+
sub_idx = 0
|
123 |
+
for i in range(len(a)):
|
124 |
+
sc = []
|
125 |
+
with open(a[i], encoding='UTF-16LE') as f:
|
126 |
+
for line in f:
|
127 |
+
if len(line) < idx+1:
|
128 |
+
continue
|
129 |
+
line = line[idx:]
|
130 |
+
if line.startswith('else'):
|
131 |
+
continue
|
132 |
+
if line.startswith('@if') and not line.startswith('@if exp="ChkSelect'):
|
133 |
+
idx += 1
|
134 |
+
continue
|
135 |
+
if line.startswith('endif') and idx > 0:
|
136 |
+
idx -= 1
|
137 |
+
continue
|
138 |
+
if line.startswith('@AddSelect') and 'invalid' not in line:
|
139 |
+
d_s.append(reg_cs.findall(line)[0][0])
|
140 |
+
if (line.startswith('@if exp="ChkSelect') or line.startswith('elsif exp="ChkSelect')) and d_s:
|
141 |
+
if line.startswith('@'):
|
142 |
+
idx += 1
|
143 |
+
n = '选择'
|
144 |
+
d = clearT(d_s[0])
|
145 |
+
d_s = d_s[1:]
|
146 |
+
if d:
|
147 |
+
sc.append(n + ':' + d)
|
148 |
+
if line.startswith('@Hitret'):
|
149 |
+
in_talk = False
|
150 |
+
if in_talk:
|
151 |
+
in_talk = False
|
152 |
+
d = clearT(line)
|
153 |
+
if d:
|
154 |
+
sc.append(n + ':' + d)
|
155 |
+
if line.startswith(r'@Talk'):
|
156 |
+
n = reg_name.findall(line)[0][0]
|
157 |
+
n = clearT(_n.get(n, n))
|
158 |
+
in_talk = True
|
159 |
+
if sc:
|
160 |
+
with open(b + f'\\{i}.txt', 'w', encoding='utf-8') as f:
|
161 |
+
f.write('\n'.join(sc))
|
162 |
+
|
163 |
+
tmp = json.dumps(_n, ensure_ascii=False, indent=2)
|