mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
fix
This commit is contained in:
parent
2a8eee528f
commit
a2ff34e0fe
@ -9,7 +9,7 @@ from myutils.utils import parsekeystringtomodvkcode, unsupportkey
|
||||
from myutils.config import globalconfig, _TR, static_data, savehook_new_data
|
||||
from myutils.subproc import subproc_w
|
||||
from myutils.wrapper import threader, tryprint
|
||||
from myutils.ocrutil import imageCut, ocr_run
|
||||
from myutils.ocrutil import imageCut, ocr_run_2
|
||||
from gui.rangeselect import rangeselct_function
|
||||
from gui.usefulwidget import (
|
||||
closeashidewindow,
|
||||
@ -131,7 +131,7 @@ class AnkiWindow(QWidget):
|
||||
|
||||
@threader
|
||||
def asyncocr(self, img):
|
||||
self.__ocrsettext.emit(ocr_run(img))
|
||||
self.__ocrsettext.emit(ocr_run_2(img))
|
||||
|
||||
def crop(self):
|
||||
def ocroncefunction(rect):
|
||||
|
@ -129,3 +129,19 @@ def ocr_run(qimage: QImage):
|
||||
msg = "<msg_error_refresh>" + _TR(globalconfig["ocr"][use]["name"]) + " " + msg
|
||||
text = msg
|
||||
return text
|
||||
|
||||
|
||||
def ocr_run_2(qimage: QImage):
|
||||
text = ocr_run(qimage)
|
||||
|
||||
msgs = [
|
||||
"<notrans>",
|
||||
"<msg_info_not_refresh>",
|
||||
"<msg_info_refresh>",
|
||||
"<msg_error_not_refresh>",
|
||||
"<msg_error_refresh>",
|
||||
]
|
||||
for msg in msgs:
|
||||
if text.startswith(msg):
|
||||
return text[len(msg) :]
|
||||
return text
|
||||
|
Loading…
x
Reference in New Issue
Block a user