mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-16 06:25:24 +00:00
Fix: Handle OCR error of "20h."
This commit is contained in:
parent
5e48c1bd74
commit
07ef351ed7
@ -389,6 +389,11 @@ class Duration(Ocr):
|
||||
}[lang]
|
||||
return re.compile(regex_str)
|
||||
|
||||
def after_process(self, result):
|
||||
result = super().after_process(result)
|
||||
result = result.strip('.,。,')
|
||||
return result
|
||||
|
||||
def format_result(self, result: str) -> timedelta:
|
||||
"""
|
||||
Do OCR on a duration, such as `18d 2h 13m 30s`, `2h`, `13m 30s`, `9s`
|
||||
|
Loading…
Reference in New Issue
Block a user