diff --git a/LunaTranslator/LunaTranslator/hiraparse/basehira.py b/LunaTranslator/LunaTranslator/hiraparse/basehira.py index cce21626..9a501019 100644 --- a/LunaTranslator/LunaTranslator/hiraparse/basehira.py +++ b/LunaTranslator/LunaTranslator/hiraparse/basehira.py @@ -3,6 +3,10 @@ from traceback import print_exc from myutils.proxy import getproxy +class KnownException(Exception): + pass + + class basehira: def init(self): pass @@ -86,6 +90,8 @@ class basehira: hira[_]["hira"] = hira[_]["hira"].replace( _ka[_reverse_idx], target[_reverse_idx] ) + except KnownException: + pass except: print_exc() return hira diff --git a/LunaTranslator/LunaTranslator/hiraparse/mecab.py b/LunaTranslator/LunaTranslator/hiraparse/mecab.py index 072a192c..fa5627d1 100644 --- a/LunaTranslator/LunaTranslator/hiraparse/mecab.py +++ b/LunaTranslator/LunaTranslator/hiraparse/mecab.py @@ -2,7 +2,7 @@ import winsharedutils import os, functools, csv, gobject from ctypes import CFUNCTYPE, c_char_p -from hiraparse.basehira import basehira +from hiraparse.basehira import basehira, KnownException # # 2.1.2 src schema # UnidicFeatures17 = namedtuple('UnidicFeatures17', @@ -65,7 +65,7 @@ class mecabwrap: fp = CFUNCTYPE(None, c_char_p, c_char_p)(cb) succ = winsharedutils.mecab_parse(self.kks, text.encode(codec), fp) if not succ: - raise Exception # failed + raise KnownException # failed return res