From 3e29891e7c434cecc57a3e5593cd8bc3ed6ceb7c Mon Sep 17 00:00:00 2001 From: Linus2punkt0 Date: Sun, 10 Mar 2024 10:34:44 +0100 Subject: [PATCH] fix split function --- output/twitter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/output/twitter.py b/output/twitter.py index e311a3f..5709f8f 100644 --- a/output/twitter.py +++ b/output/twitter.py @@ -58,8 +58,8 @@ def split_post(text): sentences = text.split(". ") i = 1 while len(first) > 280 and i < len(sentences): - first = ".".join(sentences[:(len(sentences) - i)]) + "." - second = ".".join(sentences[(len(sentences) - i):]) + first = ". ".join(sentences[:(len(sentences) - i)]) + "." + second = ". ".join(sentences[(len(sentences) - i):]) i += 1 # If splitting by sentance does not result in a short enough post, we try splitting by words instead. if len(first) > 280: