diff --git a/core/_4_2_translate.py b/core/_4_2_translate.py index 1376f88f..94cc7b71 100644 --- a/core/_4_2_translate.py +++ b/core/_4_2_translate.py @@ -23,13 +23,12 @@ def split_chunks_by_chars(chunk_size, max_i): sentence_count = 0 for sentence in sentences: if len(chunk) + len(sentence + '\n') > chunk_size or sentence_count == max_i: - chunks.append(chunk.strip()) chunk = sentence + '\n' sentence_count = 1 else: chunk += sentence + '\n' sentence_count += 1 - chunks.append(chunk.strip()) + chunks.append(chunk.strip()) return chunks # Get context from surrounding chunks @@ -109,4 +108,4 @@ def translate_all(): console.print("[bold green]✅ Translation completed and results saved.[/bold green]") if __name__ == '__main__': - translate_all() \ No newline at end of file + translate_all()