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

Fix double dashes inside ocr output

Double or more dashes in OCR predictions like "Q--010-UL" breaks the
logic in check_name because they creates ficticious empty strings after
split by dash. Fix this by manually remove the empty strings
This commit is contained in:
hephooey
2021-12-17 17:44:30 -05:00
parent afd44097b2
commit bdb54fb167

View File

@@ -381,6 +381,7 @@ class ResearchProject:
"""
name = name.strip('-')
parts = name.split('-')
parts = [i for i in parts if i]
if len(parts) == 3:
prefix, number, suffix = parts
number = number.replace('D', '0').replace('O', '0').replace('S', '5')