fix path bug with infinite word generation.

This commit is contained in:
Nitsud Yarg 2026-05-17 22:35:25 -07:00
parent 99a109b130
commit 6619ed5b32
2 changed files with 3 additions and 2 deletions

View File

@ -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)

View File

@ -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)