This repository has been archived on 2026-08-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
kb-skills/kb_workflow/srt/__init__.py
T
starmen1265 c259e0ac2f feat(12-01): implement SRT parser module
- Add Segment dataclass for subtitle segments
- Add parse_srt() function to parse SRT content string
- Add parse_srt_file() function to parse from file path
- Support standard SRT format with timestamps
- Handle special characters and multi-line subtitles

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 23:32:57 +08:00

26 lines
679 B
Python

"""SRT Processing Module
B站字幕处理模块,包含:
- SRT 解析器 (parser)
- 语义分段器 (segmenter)
- ASR 纠错器 (corrector)
"""
from kb_workflow.srt.parser import parse_srt, parse_srt_file, Segment
__all__ = [
"parse_srt",
"parse_srt_file",
"Segment",
]
# 延迟导入,避免循环依赖
def __getattr__(name: str):
if name == "SemanticSegmenter":
from kb_workflow.srt.segmenter import SemanticSegmenter
return SemanticSegmenter
if name == "ASRCorrector":
from kb_workflow.srt.corrector import ASRCorrector
return ASRCorrector
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")