Skip to content

Commit

Permalink
update the boolean function (#172)
Browse files Browse the repository at this point in the history
Co-authored-by: Shorouq <[email protected]>
  • Loading branch information
liniiiiii and i-be-snek authored Oct 18, 2024
1 parent fa3a25a commit 26823d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Evaluation/normaliser.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ def boolean(self, v):
"""Normalise boolean value. Return None if ill-defined.
Examples: " Yes" -> True, "0 " -> False, True -> True, "goat" -> None."""
v = self.string(v)
return True if v in {"1", "yes", "y", "true"} else False if v in {"0", "no", "n", "false"} else None
return (
True if v in {"1", "1.0", "yes", "y", "true"} else False if v in {"0", "0.0", "no", "n", "false"} else None
)

def sequence(self, v):
"""Normalise a string of elements separated by "&" or "|". Return an ordered list of
Expand Down

0 comments on commit 26823d8

Please sign in to comment.