From 2a930393e002848584f39b55c31f008a907e1a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Sat, 13 Apr 2024 22:45:28 +0800 Subject: [PATCH] Update post.py --- LunaTranslator/LunaTranslator/myutils/post.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/LunaTranslator/LunaTranslator/myutils/post.py b/LunaTranslator/LunaTranslator/myutils/post.py index 3e950268..3edafdca 100644 --- a/LunaTranslator/LunaTranslator/myutils/post.py +++ b/LunaTranslator/LunaTranslator/myutils/post.py @@ -320,12 +320,13 @@ def trymapnameofvndb(s): namemap = savehook_new_data[exepath]["namemap"] bettermap = {} for k, v in namemap.items(): - spja = k.split("・") - spen = v.split(" ") - if len(spja) == len(spen) and len(spen) > 1: - for i in range(len(spja)): - if len(spja[i]) >= 2: - bettermap[spja[i]] = spen[i] + for sp in ['・',' ']: + spja = k.split(sp) + spen = v.split(" ") + if len(spja) == len(spen) and len(spen) > 1: + for i in range(len(spja)): + if len(spja[i]) >= 2: + bettermap[spja[i]] = spen[i] for k, v in namemap.items(): s = s.replace(k, v)