mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
.
This commit is contained in:
parent
23474a9348
commit
98b89cd43f
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user