summaryrefslogtreecommitdiff
path: root/prolog
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.org>2015-08-27 20:38:13 +0200
committerTimotej Lazar <timotej.lazar@araneo.org>2015-08-27 20:38:13 +0200
commit801304a6972591e72d30fda6cfb641dfc3b21f3f (patch)
tree68caabd29596917419d4f892755c29a4de392d8c /prolog
parent3a74930374638887cb1ac15ec6d547fb507427c8 (diff)
Strip trailing periods from Prolog queries
Diffstat (limited to 'prolog')
-rw-r--r--prolog/engine.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/prolog/engine.py b/prolog/engine.py
index f0d1157..344c1d4 100644
--- a/prolog/engine.py
+++ b/prolog/engine.py
@@ -21,6 +21,8 @@ def create(code='', timeout=10):
return reply.get('id'), output
def ask(engine, query, timeout=10):
+ # Strip trailing whitespace and periods from the query.
+ query = query.rstrip().rstrip('.')
return send(engine, 'ask(({}),[])'.format(query), timeout=timeout)
def next(engine, n=1, timeout=10):