Skip to content

Commit c8f0be8

Browse files
Stop returning None from judge prediction function (kyuridenamida#179)
1 parent 2c0d49a commit c8f0be8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

atcodertools/constprediction/constants_prediction.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def predict_yes_no(html: str) -> Tuple[Optional[str], Optional[str]]:
108108
return yes_str, no_str
109109

110110

111-
def predict_judge_method(html: str) -> Optional[Judge]:
111+
def predict_judge_method(html: str) -> Judge:
112112
def normalize(sentence):
113113
return sentence.replace('\\', '').replace("{", "").replace("}", "").replace(",", "").replace(" ", "").replace(
114114
"−", "-").lower().strip()
@@ -151,7 +151,8 @@ def normalize(sentence):
151151
decimal_val_cands.add(int(t))
152152

153153
if len(decimal_val_cands) == 0:
154-
return None
154+
# No error value candidate is found
155+
return NormalJudge()
155156

156157
if len(decimal_val_cands) == 1:
157158
if is_absolute and is_relative:

0 commit comments

Comments
 (0)