mirror of
https://github.com/chidiwilliams/buzz.git
synced 2026-03-18 08:29:53 +01:00
Add new lines in TXT segments (#436)
This commit is contained in:
parent
0804c2743c
commit
5892e3a2a1
3 changed files with 3 additions and 5 deletions
|
|
@ -596,9 +596,7 @@ def write_output(path: str, segments: List[Segment], output_format: OutputFormat
|
|||
if output_format == OutputFormat.TXT:
|
||||
for (i, segment) in enumerate(segments):
|
||||
file.write(segment.text)
|
||||
if i < len(segments) - 1:
|
||||
file.write(' ')
|
||||
file.write('\n')
|
||||
file.write('\n')
|
||||
|
||||
elif output_format == OutputFormat.VTT:
|
||||
file.write('WEBVTT\n\n')
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ class TestWhisperCpp:
|
|||
@pytest.mark.parametrize(
|
||||
'output_format,output_text',
|
||||
[
|
||||
(OutputFormat.TXT, 'Bien venue dans\n'),
|
||||
(OutputFormat.TXT, 'Bien\nvenue dans\n'),
|
||||
(
|
||||
OutputFormat.SRT,
|
||||
'1\n00:00:00,040 --> 00:00:00,299\nBien\n\n2\n00:00:00,299 --> 00:00:00,329\nvenue dans\n\n'),
|
||||
|
|
|
|||
|
|
@ -71,4 +71,4 @@ class TestTranscriptionViewerWidget:
|
|||
export_button.menu().actions()[0].trigger()
|
||||
|
||||
output_file = open(output_file_path, 'r', encoding='utf-8')
|
||||
assert 'Bien venue dans' in output_file.read()
|
||||
assert 'Bien\nvenue dans' in output_file.read()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue