Fix: Remove currently owned info from assignment names

This commit is contained in:
LmeSzinc 2024-03-28 22:17:49 +08:00
parent 9fe20e993c
commit a135b2c3b7

View File

@ -67,7 +67,12 @@ class AssignmentOcr(Ocr):
def after_process(self, result: str):
result = super().after_process(result)
# Born to ObeyCurrently Owned:7781 -> Born to Obey
for splitter in ['Currently', 'currently', '当前持有']:
try:
result = result.split(splitter)[0]
except IndexError:
pass
if self.ocr_regex is None:
return result
matched = self.ocr_regex.fullmatch(result)