summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsand <daniel@spatof.org>2013-05-14 13:32:22 (GMT)
committer sand <daniel@spatof.org>2013-05-14 13:32:22 (GMT)
commitc51927cc7f9a98f4fceb2cdb56e44b68e90fc91d (patch)
treedc64ca667e79b39abeead1a6badb08456528714d
parentc60261fd2a3ad8a1f673c7034b83a8479a11a43b (diff)
ancora fix megahal
-rw-r--r--pinolo/plugins/megahal.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pinolo/plugins/megahal.py b/pinolo/plugins/megahal.py
index a083d96..ea2da35 100644
--- a/pinolo/plugins/megahal.py
+++ b/pinolo/plugins/megahal.py
@@ -230,7 +230,7 @@ class Brain(object):
@staticmethod
def get_words_from_phrase(phrase):
- words = [word for word in phrase.split() if word]
+ words = [word.upper() for word in phrase.split() if word]
if not words[-1].endswith("."):
words.append(".")
return words
@@ -571,4 +571,8 @@ def cmdline():
megahal = MegaHAL(brainfile=db_file)
for filename in args:
- megahal.train_from_irclog(filename)
+ print "Training from %s" % filename
+ try:
+ megahal.train_from_irclog(filename)
+ except UnicodeDecodeError, e:
+ print str(e)