Markov: abort new chain tack-on if even that's giving us __stop
This commit is contained in:
parent
a6f4827a41
commit
f15238a37e
@ -400,9 +400,12 @@ class Markov(Module):
|
||||
key_hits = self._retrieve_chains_for_key(self.start1, self.start2, context_id)
|
||||
gen_words.append(self._get_suitable_word_from_choices(key_hits, gen_words, min_size))
|
||||
|
||||
# new word 2
|
||||
key_hits = self._retrieve_chains_for_key(self.start2, found_word, context_id)
|
||||
gen_words.append(self._get_suitable_word_from_choices(key_hits, gen_words, min_size))
|
||||
if gen_words[-1] == self.stop:
|
||||
break
|
||||
else:
|
||||
# new word 2
|
||||
key_hits = self._retrieve_chains_for_key(self.start2, gen_words[-1], context_id)
|
||||
gen_words.append(self._get_suitable_word_from_choices(key_hits, gen_words, min_size))
|
||||
|
||||
# chop off the seed data at the start
|
||||
gen_words = gen_words[2:]
|
||||
|
Loading…
Reference in New Issue
Block a user