feat: add tts
This commit is contained in:
parent
25e80a7b2e
commit
7196f1493d
|
@ -42,3 +42,4 @@ media/
|
|||
Thumbs.db
|
||||
|
||||
output/
|
||||
data/
|
|
@ -33,7 +33,6 @@ A Python tool to automatically generate Anki flashcards for language learning.
|
|||
uv run -m anki_generator --input words.csv --output deck.apkg
|
||||
```
|
||||
|
||||
## To do
|
||||
- [ ] Add error logging
|
||||
- [ ] Fix image rendering
|
||||
- [ ] If word already exists, do not recreate cards
|
||||
## Enabling TTS
|
||||
|
||||
See [Anki Manual](https://docs.ankiweb.net/templates/fields.html#text-to-speech-for-individual-fields).
|
|
@ -53,7 +53,9 @@ class CardGenerator:
|
|||
{
|
||||
'name': 'German Vocabulary Card',
|
||||
'qfmt': '''
|
||||
<div style="font-size: 24px;">{{German_Word}}</div>
|
||||
<div style="font-size: 24px;">
|
||||
{{German_Word}} {{tts de_DE:German_Word}}
|
||||
</div>
|
||||
<div style="font-size: 18px;">Part of speech: {{Part_of_Speech}}</div>
|
||||
<div style="font-size: 14px;">Source: {{Source}}</div>
|
||||
{{Image}}
|
||||
|
@ -64,7 +66,9 @@ class CardGenerator:
|
|||
<div><b>English meaning:</b> {{English_Meaning}}</div>
|
||||
<div><b>Article:</b> {{Article}}</div>
|
||||
<div><b>Plural Form:</b> {{Plural_Form}}</div>
|
||||
<div><b>Example:</b> {{Example_Sentence}}</div>
|
||||
<div>
|
||||
<b>Example:</b> {{Example_Sentence}} {{tts de_DE:Example_Sentence}}
|
||||
</div>
|
||||
<div><b>Translation:</b> {{Sentence_Translation}}</div>
|
||||
<div><b>Usage notes:</b> {{Usage_Notes}}</div>
|
||||
<div><b>Related words:</b> {{Related_Words}}</div>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import os
|
||||
from typing import List, Optional
|
||||
from pydantic import BaseModel, Field, HttpUrl
|
||||
from pydantic_settings import BaseSettings
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
Bauch,Babbel
|
||||
Kopf,Babbel
|
||||
Rücken,Babbel
|
||||
verlinken, Easy German 546: Die Brandmauer
|
||||
Lieblingsthema, Easy German 546: Die Brandmauer
|
||||
Zahnvorsorge, Easy German 546: Die Brandmauer
|
||||
Vorsorgeuntersuchung, Easy German 546: Die Brandmauer
|
||||
Untersuchung, Easy German 546: Die Brandmauer
|
|
Loading…
Reference in New Issue