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