Markov: don't crash when learning a sentence that's only whitespace
This commit is contained in:
parent
c17623bcf6
commit
2b8f0d2843
|
@ -187,6 +187,9 @@ class Markov(Module):
|
||||||
k2 = self.start2
|
k2 = self.start2
|
||||||
|
|
||||||
words = line.split()
|
words = line.split()
|
||||||
|
if len(words) <= 0:
|
||||||
|
return line
|
||||||
|
|
||||||
self.starts.append(words[0])
|
self.starts.append(words[0])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue