From a135b2c3b774952096d45be69cf8f84e285624f7 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Thu, 28 Mar 2024 22:17:49 +0800 Subject: [PATCH] Fix: Remove currently owned info from assignment names --- tasks/assignment/ui.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tasks/assignment/ui.py b/tasks/assignment/ui.py index f46fa5ae4..895fe0c38 100644 --- a/tasks/assignment/ui.py +++ b/tasks/assignment/ui.py @@ -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)