summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsand <daniel@spatof.org>2013-05-14 13:28:42 (GMT)
committer sand <daniel@spatof.org>2013-05-14 13:28:42 (GMT)
commitc60261fd2a3ad8a1f673c7034b83a8479a11a43b (patch)
tree666ac116f321a573d985c11e7ec90a2ca34f8607
parent7e9f81b3866854888b77d03d15ac9e40008f9d0d (diff)
dirty patch per megahal
-rw-r--r--pinolo/plugins/megahal.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/pinolo/plugins/megahal.py b/pinolo/plugins/megahal.py
index 4ad6ffa..a083d96 100644
--- a/pinolo/plugins/megahal.py
+++ b/pinolo/plugins/megahal.py
@@ -181,7 +181,7 @@ class Brain(object):
return self.db['order']
@staticmethod
- def get_words_from_phrase(phrase):
+ def old_get_words_from_phrase(phrase):
phrase = phrase.upper()
words = []
if phrase:
@@ -228,6 +228,13 @@ class Brain(object):
words[-1] = '.'
return words
+ @staticmethod
+ def get_words_from_phrase(phrase):
+ words = [word for word in phrase.split() if word]
+ if not words[-1].endswith("."):
+ words.append(".")
+ return words
+
def communicate(self, phrase, learn=True, reply=True):
words = self.get_words_from_phrase(phrase)
if learn: