From 50935a5d28d31704e22bcbd5d93b50fb74570d0b Mon Sep 17 00:00:00 2001 From: Mohamed Moataz Date: Wed, 27 Mar 2024 19:03:50 +0200 Subject: [PATCH] fix: :bug: Minor fix --- utils/process_post.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/process_post.py b/utils/process_post.py index defef84..dc3df19 100644 --- a/utils/process_post.py +++ b/utils/process_post.py @@ -11,16 +11,16 @@ def split_text(text, threshold): new_text = '' texts = [] - for i in text: + for i in range(len(text)): if new_text == '': - new_text = i + new_text = text[i] continue - new_text += ' ' + i + new_text += ' ' + text[i] if len(new_text) >= int(0.75 * threshold): go = True # Make sure that the text left is not so short - if i != text[-1]: + if i < len(text) - 1: left = ' '.join(text[i+1:]) if len(left) < int(0.25 * threshold): go = False