fix: 🐛 Minor fix

pull/2058/head
Mohamed Moataz 2 years ago
parent e56d09212e
commit 50935a5d28

@ -11,16 +11,16 @@ def split_text(text, threshold):
new_text = '' new_text = ''
texts = [] texts = []
for i in text: for i in range(len(text)):
if new_text == '': if new_text == '':
new_text = i new_text = text[i]
continue continue
new_text += ' ' + i new_text += ' ' + text[i]
if len(new_text) >= int(0.75 * threshold): if len(new_text) >= int(0.75 * threshold):
go = True go = True
# Make sure that the text left is not so short # Make sure that the text left is not so short
if i != text[-1]: if i < len(text) - 1:
left = ' '.join(text[i+1:]) left = ' '.join(text[i+1:])
if len(left) < int(0.25 * threshold): if len(left) < int(0.25 * threshold):
go = False go = False

Loading…
Cancel
Save