add None/empty check to score_answer of cryptarithm

This commit is contained in:
Andreas Koepf 2025-02-25 23:27:01 +01:00
parent 6d5168d1e5
commit 65d17b9850

View file

@ -223,6 +223,9 @@ class CryptarithmDataset(ProceduralDataset):
Returns:
float: The computed score between 0.0 and 1.0.
"""
if not answer:
return 0.0
correct_mapping = {}
correct_answer_str = entry["answer"] # e.g. "A=1,B=7,..."
for pair in correct_answer_str.split(","):