i forgot to strip mentions from the code when fake_mentions is set to never because i'm have smol bun brain please give headpat

This commit is contained in:
Lynne Megido 2019-09-19 16:17:26 +10:00
parent 8b26dfbfc0
commit 798b5a484b

View File

@ -95,14 +95,14 @@ def make_post(args):
print("No posts to learn from.")
return
model = nlt_fixed(posts)
tries = 0
post = None
if bot['fake_mentions'] == 'never':
# remove all mentions from the training data before the markov model sees it
posts = re.sub(r"(?<!\S)@\w+(@[\w.]+)?\s?", "", posts)
model = nlt_fixed(posts)
tries = 0
post = None
# even with such a high tries value for markovify, it still sometimes returns none.
# so we implement our own tries function as well, and try ten times.
while post is None and tries < 10: