Markov: check for start2-only lists correctly while working backwards

what i was doing before had practically no chance of working right,
so that's fun
This commit is contained in:
Brian S. Stephan 2012-07-30 10:25:13 -05:00
parent e8e4354358
commit c064f6ebe1
1 changed files with 1 additions and 1 deletions

View File

@ -379,7 +379,7 @@ class Markov(Module):
gen_words += working_backwards
self.log.debug("gen_words: {0:s}".format(" ".join(gen_words)))
break
elif len(key_hits) == 1 and self.start2 in key_hits:
elif len(filter(lambda a: a!= self.start2, key_hits)) == 0:
self.log.debug("only start2 in key_hits, finishing")
gen_words += working_backwards
self.log.debug("gen_words: {0:s}".format(" ".join(gen_words)))