Vocabgenerator is a python utility that scrapes thai-language.com to make Anki flashcards with voiceovers of words.
Clone this repo to your device
This project uses poetry as its dependency manager, so have that installed
pip install poetry
In the main folder, run poetry install
to install all required packages and dependencies
Sign up for Google Cloud, and create a project. Create a JSON key for TTS and add it to the root folder.
Next, figure out the directory where Anki stores all media for flashcards
In the main folder, create a config.yml
file as follows:
gcloud:
filename: SERVICE_ACCOUNT_JSON_LOCATION
user:
media-location: ANKI_MEDIA_LOCATION
Vocabgenerator takes a .txt file containing line-separated words to process, or manual entry of words.
แอปเปิ้ล
ส้ม
กล้วย
poetry run python bot.py words.txt
poetry run python bot.py
The created flashcards will be stored in ./results
, and are output as a csv of [word, transliteration, definition, example]
Then, import the deck into Anki. A sample card type:
Front:
{{Front}}
Back:
{{FrontSide}}
<br>
{{Translit}}
<hr id=answer>
{{Back}}
<hr>
{{Back2}}