chore!: add recognize parts

This commit is contained in:
2023-06-10 18:32:23 +08:00
parent 4f26fd1b59
commit ea31aaf00c
2 changed files with 46 additions and 20 deletions

View File

@ -88,7 +88,11 @@ def filter_digit_results(
if possible_results:
# Sort the results based on "max_val" in descending order and select the top result
result = sorted(possible_results, key=lambda d: d["max_val"], reverse=True)[0]
result = sorted(
possible_results,
key=lambda d: d["max_val"],
reverse=True,
)[0]
result_digit = result["digit"] # Get the digit value from the result
result.pop("digit", None) # Remove the digit key from the result