Markov: remove some debugging i forgot to clean out before the initial commit

This commit is contained in:
Brian S. Stephan 2011-01-18 22:51:40 -06:00
parent 9841a51f21
commit 3283fac1ff
1 changed files with 0 additions and 3 deletions

View File

@ -199,7 +199,6 @@ class Markov(Module):
# get a random word from the input
words = line.split()
target_word = words[random.randint(0, len(words)-1)]
print('trying ' + target_word)
# start with an empty chain, and work from there
gen_words = [self.start1, self.start2]
@ -208,11 +207,9 @@ class Markov(Module):
while len(gen_words) < size + 2 and gen_words[-1] != self.stop:
# use the chain that includes the target word, if it is found
if target_word in self.brain[(gen_words[-2], gen_words[-1])]:
print('found ' + target_word)
gen_words.append(target_word)
# generate new word
target_word = words[random.randint(0, len(words)-1)]
print('trying ' + target_word)
else:
gen_words.append(random.choice(self.brain[(gen_words[-2], gen_words[-1])]))