Markov: remove some debugging i forgot to clean out before the initial commit
This commit is contained in:
parent
9841a51f21
commit
3283fac1ff
@ -199,7 +199,6 @@ class Markov(Module):
|
|||||||
# get a random word from the input
|
# get a random word from the input
|
||||||
words = line.split()
|
words = line.split()
|
||||||
target_word = words[random.randint(0, len(words)-1)]
|
target_word = words[random.randint(0, len(words)-1)]
|
||||||
print('trying ' + target_word)
|
|
||||||
|
|
||||||
# start with an empty chain, and work from there
|
# start with an empty chain, and work from there
|
||||||
gen_words = [self.start1, self.start2]
|
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:
|
while len(gen_words) < size + 2 and gen_words[-1] != self.stop:
|
||||||
# use the chain that includes the target word, if it is found
|
# use the chain that includes the target word, if it is found
|
||||||
if target_word in self.brain[(gen_words[-2], gen_words[-1])]:
|
if target_word in self.brain[(gen_words[-2], gen_words[-1])]:
|
||||||
print('found ' + target_word)
|
|
||||||
gen_words.append(target_word)
|
gen_words.append(target_word)
|
||||||
# generate new word
|
# generate new word
|
||||||
target_word = words[random.randint(0, len(words)-1)]
|
target_word = words[random.randint(0, len(words)-1)]
|
||||||
print('trying ' + target_word)
|
|
||||||
else:
|
else:
|
||||||
gen_words.append(random.choice(self.brain[(gen_words[-2], gen_words[-1])]))
|
gen_words.append(random.choice(self.brain[(gen_words[-2], gen_words[-1])]))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user