A language learning utility with Anki integration
Project description
Ankipan
Ankipan is a language learning utility which systematically tracks the words you already know, and allows you to parse any source you are personally interested in (text, subtitles, websites, lyrics etc.) for new words to learn.
New words are internally stored and converted to Anki Flashcards, which contain customizable content such as scraped dictionary definitions and example sentences from different sources.
Currently supported languages are japanese, german, french and english.
Getting started
1. Prerequisites
- Download and install anki from https://apps.ankiweb.net/
- Create an account on their website
- Install the ankiconnect plugin from https://ankiweb.net/shared/info/2055492159
- Open the app and login, keep anki open when syncing databases (in anki, open Tools -> Add Ons -> Get Add-Ons -> paste code 2055492159)
2. Installation
# Clone the repository
git clone git@gitlab.com:ankipan/ankipan_db.git
cd ankipan_db
# Install dependencies:
python -m pip install -r requirements.txt
3. (Optional) Install lemmatizers to parse your own texts
- Download pytorch from https://pytorch.org/get-started/locally/ (for stanza lemma parsing)
- install dependencies:
pip install stanza hanta
- Select language, currently supported are 'jp, 'de', 'fr', 'en', see https://stanfordnlp.github.io/stanza/performance.html
python -c "import stanza; stanza.download('jp')"
Usage
See interactive notebook in /examples
# Create a new collection with your name, learning language and native language
from ankipan import Collection
collection = Collection('testcollection', source_lang='jp', native_lang='en')
# Specify content to be downloaded for flashcards (see collection.get_available_sources() for example sentences and scraper.py module)
collection.section_names = ['sentences_anime', 'sentences_lyrics', 'sentences_youtube', 'jisho', 'wadoku', 'wikitionary_en', 'wikitionary_jp']
# Specify a source the words of which you would like to add to your collection, either from db or path textfile or folder with textfiles
# Alternatively, specify source name from db or string or wordcounts directly (see help(Collection.collect))
words = collection.collect('example_text_jp.txt')
# Select the words you already know and the words you would like to learn from the table overview
words.select_new_words()
# Add words to collection
collection.add_deck(words, 'example_source')
# Optional: Persist collection state to harddrive (see /'.data' folder)
collection.save()
# Download content for new cards (also autosaves collection to drive)
collection.fetch('example_source')
# Sync current collection with anki to upload them to currently open anki instance
collection.sync_with_anki('testsource')
Notes
-
Current lemmatization is done via the
stanzalibrary in the reader.py module. While this works mostly fine, the library still just uses a statistical model to estimate the likely word roots (lemmas) of the different pieces of sentences. It sometimes makes mistakes, which requires the users to manually filter them in theselect_new_wordsoverview, or suspend the card later on in anki. -
The translation engine running on the server has a limited quota. Once it has been exceeded for the day, users will have to specify their own API key which is then locally used for translations. (TODO)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ankipan-0.1.tar.gz.
File metadata
- Download URL: ankipan-0.1.tar.gz
- Upload date:
- Size: 44.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
179dae76b7f3be3c19c633ca90b5f263eb2048615aa8bed19c0416f9227f9996
|
|
| MD5 |
0fd9e1c3b9c58ebe2475704d000c9828
|
|
| BLAKE2b-256 |
c9238aff8228a8060d3912feeafe4cee76a88ae29a1c09ee7593a39ba52f0756
|
File details
Details for the file ankipan-0.1-py3-none-any.whl.
File metadata
- Download URL: ankipan-0.1-py3-none-any.whl
- Upload date:
- Size: 45.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41fad7efaabaedac218cac75efacec9f5ded9e13c69b6ea7c6417a7876c899f4
|
|
| MD5 |
f4bc3dce4968bd75f092d0846556a838
|
|
| BLAKE2b-256 |
1c7668a5094a8754f367bf1b00b7bf5319cd5686d2ad84bca14b33b54060df7d
|