1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-14 14:49:25 +08:00

Merge remote-tracking branch 'LmeSzinc/master' into dev

# Conflicts:
#	module/config/argument/args.json
#	module/config/i18n/en-US.json
#	module/config/i18n/ja-JP.json
#	module/config/i18n/zh-CN.json
#	module/config/i18n/zh-TW.json
This commit is contained in:
0O0o0oOoO00
2026-02-28 12:16:14 +08:00
30 changed files with 1251 additions and 84 deletions

View File

@@ -41,11 +41,21 @@ class CampaignOcr(ModuleBase):
@staticmethod
def _campaign_ocr_result_process(result):
# The result will be like '7--2', because tha dash in game is '' not '-'
result = result.lower().replace('--', '-').replace('--', '-')
if result.startswith('-'):
result = result[1:]
result = result.replace('--', '-').replace('--', '-').lstrip('-')
# Replace wrong 'I' from results like 'I1-1', '1I-1', 'I-I', '11-I', 'I4-4', to '1'
# while keeping results like 'isp-2', 'sp1'
def replace_func(match):
segment = match.group(0)
return segment.replace('I', '1')
result = re.sub(r'[0-9I]+-[0-9I]+', replace_func, result, count=1)
# Convert '72' to '7-2'
if len(result) == 2 and result[0].isdigit():
result = '-'.join(result)
result = result.lower()
return result
@staticmethod