1234
This commit is contained in:
parent
56c892a577
commit
9e37e8ec14
7
04.py
7
04.py
@ -7,7 +7,7 @@ import re
|
|||||||
def clean_text(text):
|
def clean_text(text):
|
||||||
text = re.sub(r"[#&]", "\n", text)
|
text = re.sub(r"[#&]", "\n", text)
|
||||||
text = re.sub(r"^(\\[A-Za-z0-9]{2}\s*)+", "", text)
|
text = re.sub(r"^(\\[A-Za-z0-9]{2}\s*)+", "", text)
|
||||||
text = re.sub(r"/%*\$", "", text)
|
text = re.sub(r"/%*$", "", text)
|
||||||
text = re.sub(r"\^1", "", text)
|
text = re.sub(r"\^1", "", text)
|
||||||
return text
|
return text
|
||||||
|
|
||||||
@ -38,7 +38,8 @@ def restore_text(key, text, source_text):
|
|||||||
text = re.sub(r"(?<!\^[0-9])([。!?\?!,\.,:]+)(?=\s*[\w&])", replacer, text)
|
text = re.sub(r"(?<!\^[0-9])([。!?\?!,\.,:]+)(?=\s*[\w&])", replacer, text)
|
||||||
|
|
||||||
# 3. 恢复后缀控制符 /%*$
|
# 3. 恢复后缀控制符 /%*$
|
||||||
match_suffix = re.search(r"/%*\$$", source_text.get(key, ""))
|
match_suffix = re.search(r"/%*$", source_text.get(key, ""))
|
||||||
|
|
||||||
if match_suffix:
|
if match_suffix:
|
||||||
text = text + match_suffix.group(0)
|
text = text + match_suffix.group(0)
|
||||||
|
|
||||||
@ -86,4 +87,4 @@ def process_all_jsons(original_root, processed_root, target_root):
|
|||||||
|
|
||||||
# 运行入口
|
# 运行入口
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
process_all_jsons("text_target", "text_processed", "text_target")
|
process_all_jsons("text_original", "text_processed", "text_target")
|
||||||
|
@ -3706,7 +3706,7 @@
|
|||||||
"obj_credits_slash_Step_0_gml_192_0": "in Chapter 3",
|
"obj_credits_slash_Step_0_gml_192_0": "in Chapter 3",
|
||||||
"obj_credits_slash_Step_0_gml_192_0_b": "Website",
|
"obj_credits_slash_Step_0_gml_192_0_b": "Website",
|
||||||
"obj_cutscene_maker_slash_Draw_0_gml_60_0": "actor, ~1 step:~2",
|
"obj_cutscene_maker_slash_Draw_0_gml_60_0": "actor, ~1 step:~2",
|
||||||
"obj_cutscene_test_slash_Step_0_gml_51_0": "\\E7* Hey^1, is that.. Lancer!?/%",
|
"obj_cutscene_test_slash_Step_0_gml_51_0": "\\E7* Hey^1, is that..^1. Lancer!?/%",
|
||||||
"obj_cutscene_test_slash_Step_0_gml_78_0": "\\E2* What are you up to^1, buddy?/%",
|
"obj_cutscene_test_slash_Step_0_gml_78_0": "\\E2* What are you up to^1, buddy?/%",
|
||||||
"obj_cutscene_test_slash_Step_0_gml_87_0": "\\E1* Lancer?/%",
|
"obj_cutscene_test_slash_Step_0_gml_87_0": "\\E1* Lancer?/%",
|
||||||
"obj_cutscene_test_slash_Step_0_gml_96_0": "\\E2* Ho ho ho!!^1! Susie!!!/%",
|
"obj_cutscene_test_slash_Step_0_gml_96_0": "\\E2* Ho ho ho!!^1! Susie!!!/%",
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -3706,7 +3706,7 @@
|
|||||||
"obj_credits_slash_Step_0_gml_192_0": "in Chapter 3",
|
"obj_credits_slash_Step_0_gml_192_0": "in Chapter 3",
|
||||||
"obj_credits_slash_Step_0_gml_192_0_b": "Website",
|
"obj_credits_slash_Step_0_gml_192_0_b": "Website",
|
||||||
"obj_cutscene_maker_slash_Draw_0_gml_60_0": "actor, ~1 step:~2",
|
"obj_cutscene_maker_slash_Draw_0_gml_60_0": "actor, ~1 step:~2",
|
||||||
"obj_cutscene_test_slash_Step_0_gml_51_0": "\\E7* Hey^1, is that.. Lancer!?/%",
|
"obj_cutscene_test_slash_Step_0_gml_51_0": "\\E7* Hey^1, is that..^1. Lancer!?/%",
|
||||||
"obj_cutscene_test_slash_Step_0_gml_78_0": "\\E2* What are you up to^1, buddy?/%",
|
"obj_cutscene_test_slash_Step_0_gml_78_0": "\\E2* What are you up to^1, buddy?/%",
|
||||||
"obj_cutscene_test_slash_Step_0_gml_87_0": "\\E1* Lancer?/%",
|
"obj_cutscene_test_slash_Step_0_gml_87_0": "\\E1* Lancer?/%",
|
||||||
"obj_cutscene_test_slash_Step_0_gml_96_0": "\\E2* Ho ho ho!!^1! Susie!!!/%",
|
"obj_cutscene_test_slash_Step_0_gml_96_0": "\\E2* Ho ho ho!!^1! Susie!!!/%",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user