Skip to main content

A language learning utility with Anki integration

Project description

Ankipan

Ankipan is a language learning utility which systematically tracks the words you already know or are currently learning, and allows you to parse any source you are personally interested in (text, subtitles, websites, lyrics etc.) for the most relevant new words.

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 (jp), german (de), french (fr) and english (en).

Getting started

1. Prerequisites

2. Installation

# Clone the repository
git clone git@gitlab.com:ankipan/ankipan.git
cd ankipan

# Install dependencies:
python -m pip install -r requirements.txt

3. (Optional) Install lemmatizers to parse your own texts

 pip install stanza hanta
 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.set_flashcard_fields(definitions=['jisho', 'wadoku', 'wikitionary_en', 'wikitionary_jp'],
                                    sentence_sources=['lyrics', 'youtube'])

# Specify a source the words of which you would like to add to your deck, either directly as string, as path to file or folder, or directly by source name (see source names from collection.get_available_sources())
words = collection.collect(string='本音言う無邪気なペース')
# words = collection.collect('example_text_jp.txt')
# words = collection.collect(source_name='Tatsuya-kitani')

# 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 stanza library 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 the select_new_words overview, 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

ankipan-0.2.tar.gz (44.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ankipan-0.2-py3-none-any.whl (45.6 kB view details)

Uploaded Python 3

File details

Details for the file ankipan-0.2.tar.gz.

File metadata

  • Download URL: ankipan-0.2.tar.gz
  • Upload date:
  • Size: 44.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for ankipan-0.2.tar.gz
Algorithm Hash digest
SHA256 632d7f03a8c6aa988af899003e4ec99ef526995313cdcb3893de4315d7184521
MD5 b0e049c83e32d242f6e28b1c0edf294b
BLAKE2b-256 4397bf5f3be3bccf364f5b42136bb5d1cd0ee5594f4dcb5fe7a0dc463f53b58c

See more details on using hashes here.

File details

Details for the file ankipan-0.2-py3-none-any.whl.

File metadata

  • Download URL: ankipan-0.2-py3-none-any.whl
  • Upload date:
  • Size: 45.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for ankipan-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8415ed7cc9f3da25557d0bb91d94ad2f0e7f487d75d76318d7d67fd833180755
MD5 cb1d7cabd6e511b89ac378655f30a0e2
BLAKE2b-256 4548e20e46c58e4bffe70bf217f8c153cfe7be43ccca9bdc0326bec01aea3acd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page