Fixed output - no more bracelets later

This commit is contained in:
Luka 2019-11-05 09:26:21 +01:00
parent 053a1d70d1
commit 38271016db

View File

@ -202,7 +202,11 @@ def printable_answers(query):
# res.extend(printable_answers(node_action[1:-1]))
# res.extend([node_actions[-1]])
for node_action in node_actions:
res.extend(printable_answers(node_action))
# if command in bracelets remove them and treat command as new query
if node_action[0] == '(' and node_action[-1] == ')':
res.extend(printable_answers(node_action[1:-1]))
else:
res.extend([node_action])
return res
else:
return [query]