diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index c3e36cb..eb98ca1 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,4 +1,4 @@ -## Related issues / PRs +## Related issues / PRs. Summarize issues. - # ## Summarize Changes diff --git a/modules/utils/subtitle_manager.py b/modules/utils/subtitle_manager.py index 1a6ad12..3321c00 100644 --- a/modules/utils/subtitle_manager.py +++ b/modules/utils/subtitle_manager.py @@ -91,6 +91,9 @@ def write_result( ): raise NotImplementedError + def to_segments(self, file_path: str): + raise NotImplementedError + class WriteTXT(ResultWriter): extension: str = "txt" @@ -101,6 +104,19 @@ def write_result( for segment in result["segments"]: print(segment["text"].strip(), file=file, flush=True) + def to_segments(self, file_path: str): + segments = [] + + blocks = read_file(file_path).split('\n') + + for block in blocks: + segments.append(Segment( + start=None, + end=None, + text=block + )) + return segments + class SubtitlesWriter(ResultWriter): always_include_hours: bool