From f39fbc9c67ecd02aa09e694e9364199e970283cf Mon Sep 17 00:00:00 2001 From: Lynne Date: Mon, 29 Oct 2018 06:28:56 +1000 Subject: [PATCH] bots should no longer get stuck in a loop forever --- create.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/create.py b/create.py index 43e6c49..152a5cd 100755 --- a/create.py +++ b/create.py @@ -29,8 +29,9 @@ def make_sentence(output): os.remove("toots-copy.db") sentence = None - while sentence is None or re.match("^@\u202B", sentence): + while sentence is None: sentence = model.make_short_sentence(500, tries=10000) + sentence = re.sub("^@\u202B[^ ]* ", "", sentence) output.send(sentence) def make_toot(force_markov = False, args = None):