Markov: trivial code cleanup

This commit is contained in:
Brian S. Stephan 2012-07-29 17:46:14 -05:00
parent 14fd5721c1
commit b327bcab71
1 changed files with 2 additions and 2 deletions

View File

@ -288,7 +288,7 @@ class Markov(Module):
# don't learn recursion
if not event._recursing:
words = line.split()
if len(words) <= 0:
if len(words) == 0:
return line
db = self.get_db()
@ -465,7 +465,7 @@ class Markov(Module):
if len(gen_words) < min_size + 2 and len(filter(lambda a: a != self.stop, key_hits)) > 0:
found_word = random.choice(filter(lambda a: a != self.stop, key_hits))
return found_word
elif len(key_hits) <= 0:
elif len(key_hits) == 0:
return self.stop
else:
found_word = random.choice(key_hits)