Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
adjust call to lisp_to_nested_expression (#2347)
Browse files Browse the repository at this point in the history
  • Loading branch information
OyvindTafjord authored and kl2806 committed Jan 11, 2019
1 parent 43ea97c commit 4c5de57
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions allennlp/semparse/worlds/quarel_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ def execute(self, lf_raw: str) -> int:
# Remove "a:" prefixes from attributes (hack)
logical_form = re.sub(r"\(a:", r"(", lf_raw)
parse = semparse_util.lisp_to_nested_expression(logical_form)
if len(parse) < 1 and len(parse[0]) < 2:
if len(parse) < 2:
return -1
if parse[0][0] == 'infer':
args = [self._exec_and(arg) for arg in parse[0][1:]]
if parse[0] == 'infer':
args = [self._exec_and(arg) for arg in parse[1:]]
if None in args:
return -1
return self._exec_infer(*args)
Expand Down

0 comments on commit 4c5de57

Please sign in to comment.