fix: remove semicolon and dot in ocr results

This commit is contained in:
2026-07-05 16:22:33 +08:00
parent 004af69d8f
commit 8dc527b06b
+3 -2
View File
@@ -6,12 +6,13 @@ from typing import ClassVar
import module.config.server as server
from module.exception import ScriptError
REGEX_PUNCTUATION = re.compile(r'[ ,.\'"“”,。::!!??·•\-—/\\\n\t()\[\]()「」『』【】《》[]]')
# ord('.') = 65294
REGEX_PUNCTUATION = re.compile(r'[ ,..\'"“”,。::;;!!??·•\-—/\\\n\t()\[\]()「」『』【】《》[]]')
def parse_name(n):
n = REGEX_PUNCTUATION.sub('', str(n)).lower()
return n
return n.strip()
@dataclass