From 99a109b1305a0c36f5152acd0d499cab9ac5e176 Mon Sep 17 00:00:00 2001 From: Nitsud Yarg Date: Sun, 17 May 2026 22:02:36 -0700 Subject: [PATCH] subtitle parser can match webvtt and srt formats --- subtitle_processor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/subtitle_processor.py b/subtitle_processor.py index 6490091..cce1dd1 100644 --- a/subtitle_processor.py +++ b/subtitle_processor.py @@ -63,6 +63,10 @@ def main(): notes_lines.append('##### ' + lines[i].strip() + " `" + lines[i+1].strip() + "`" + "\n") i+=2 continue + if re.fullmatch(r'(\d{2,}:)*\d{2,}:\d{2,}[,.]\d{3,}\s*-->\s*(\d{2,}:)*\d{2,}:\d{2,}[,.]\d{3,}' , lines[i].strip()): + notes_lines.append('##### ' " `" + lines[i].strip() + "`" + "\n") + i+=1 + continue if has_japanese(lines[i]): print(lines[i]) result = analyze(lines[i],vocab)