Markov: don't crash when learning a sentence that's only whitespace

This commit is contained in:
Brian S. Stephan 2011-03-14 13:14:56 -05:00
parent c17623bcf6
commit 2b8f0d2843
1 changed files with 3 additions and 0 deletions

View File

@ -187,6 +187,9 @@ class Markov(Module):
k2 = self.start2
words = line.split()
if len(words) <= 0:
return line
self.starts.append(words[0])
try: