1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-11 20:58:19 +08:00

Refactor: Digit ocr white list

This commit is contained in:
LmeSzinc
2022-10-02 18:25:07 +08:00
parent 66170b8edb
commit 24ef0521b3
5 changed files with 31 additions and 38 deletions

View File

@@ -24,15 +24,9 @@ OCR_META_DAMAGE = Digit(META_DAMAGE, name='OCR_META_DAMAGE')
class MetaDigitCounter(DigitCounter):
def __init__(self, *args, **kwargs):
kwargs['alphabet'] = '0123456789/I'
super().__init__(*args, **kwargs)
def after_process(self, result):
result = super().after_process(result)
# I00/200 -> 100/200
result = result.replace('I', '1')
# 00/200 -> 100/200
if result.startswith('00/'):
result = '100/' + result[3:]