From 801304a6972591e72d30fda6cfb641dfc3b21f3f Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Thu, 27 Aug 2015 20:38:13 +0200 Subject: Strip trailing periods from Prolog queries --- prolog/engine.py | 2 ++ 1 file changed, 2 insertions(+) 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): -- cgit v1.2.1