From 7a53aaa9a11b761c408d1a03e779d58db97f67e3 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Fri, 25 Feb 2011 20:59:57 -0600 Subject: [PATCH] Markov: properly output unicode chains --- modules/Markov.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Markov.py b/modules/Markov.py index c324a7c..f7c0667 100644 --- a/modules/Markov.py +++ b/modules/Markov.py @@ -250,7 +250,7 @@ class Markov(Module): if gen_words[-1] == self.stop: gen_words = gen_words[:-1] - return ' '.join(gen_words) + return ' '.join(gen_words).encode('utf-8', 'ignore') def _reply_to_line(self, line, min_size=15, max_size=100): """Reply to a line, using some text in the line as a point in the chain.""" @@ -291,7 +291,7 @@ class Markov(Module): if gen_words[-1] == self.stop: gen_words = gen_words[:-1] - return ' '.join(gen_words) + return ' '.join(gen_words).encode('utf-8', 'ignore') def _retrieve_chains_for_key(self, k1, k2): """Get the value(s) for a given key (a pair of strings)."""