This commit is contained in:
Johan Nordberg 2022-05-28 01:29:34 +00:00
parent 069e7001ad
commit 821be4171b

View File

@ -60,7 +60,7 @@ def split_and_recombine_text(text, desired_length=200, max_length=300):
split_pos.append(pos) split_pos.append(pos)
if len(current) >= desired_length: if len(current) >= desired_length:
commit() commit()
# treat end of quote as a boundary if its preceded by a space or newline # treat end of quote as a boundary if its followed by a space or newline
elif in_quote and peek(1) == '"' and peek(2) in '\n ': elif in_quote and peek(1) == '"' and peek(2) in '\n ':
seek(2) seek(2)
split_pos.append(pos) split_pos.append(pos)