mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-04-01 13:54:53 +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:
@@ -381,6 +381,7 @@ class ResearchProject:
|
|||||||
"""
|
"""
|
||||||
name = name.strip('-')
|
name = name.strip('-')
|
||||||
parts = name.split('-')
|
parts = name.split('-')
|
||||||
|
parts = [i for i in parts if i]
|
||||||
if len(parts) == 3:
|
if len(parts) == 3:
|
||||||
prefix, number, suffix = parts
|
prefix, number, suffix = parts
|
||||||
number = number.replace('D', '0').replace('O', '0').replace('S', '5')
|
number = number.replace('D', '0').replace('O', '0').replace('S', '5')
|
||||||
|
|||||||
Reference in New Issue
Block a user