From 6619ed5b32e8c3d7a98ed6db6612df824e587998 Mon Sep 17 00:00:00 2001 From: Nitsud Yarg Date: Sun, 17 May 2026 22:35:25 -0700 Subject: [PATCH] fix path bug with infinite word generation. --- fugashi_parser.py | 4 ++-- subtitle_processor.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fugashi_parser.py b/fugashi_parser.py index 62addd5..b048ba5 100644 --- a/fugashi_parser.py +++ b/fugashi_parser.py @@ -363,10 +363,10 @@ def analyze(text: str, vocab: Dict[str, Dict]): } def write_word_note(word: str, destination_dir: Path): - if Path(destination_dir.joinpath('/' + word + '.md')).exists() == False: + if Path(destination_dir.joinpath(word + '.md')).exists() == False: definitions = anki_fields_term(word) if definitions.get("fields"): - with open(destination_dir.as_posix() + '/' + word + '.md', 'w') as vocab_note: + with open(destination_dir.joinpath(word + '.md'), 'w') as vocab_note: for entry in definitions.get("fields"): #vocab_note.write("\n") #print(entry['expression'], file=vocab_note) diff --git a/subtitle_processor.py b/subtitle_processor.py index cce1dd1..646061b 100644 --- a/subtitle_processor.py +++ b/subtitle_processor.py @@ -85,6 +85,7 @@ def main(): ## Lookup vocab for word in vocab: write_word_note(word, destination_path) + return # with open("/run/media/deck/YF8SD/Video/Yu-Gi-Oh! Duel Monsters - 001.vtt", "w", encoding="utf-8") as f: # f.writelines(lines)