Skip to main content

Toisto is a command-line app to practice languages.

Project description

Toisto

Command-line app to practice languages. Toisto is Finnish and means reiteration, playback, repetition, reproduction.

Toisto is alpha software at the moment. It comes with a limited set of words and phrases in Dutch and Finnish.

User guide

How to install

Make sure you have these prequisities installed:

Install Toisto as follows:

$ pipx install Toisto

How to use

Start Toisto as follows, giving the language you want to practice as argument, either nl or fi at the moment:

$ toisto fi

To practice a specific deck, pass it as follows:

$ toisto fi --deck colors

Add --help or -h to get help information:

$ toisto --help

Example session

👋 Welcome to Toisto v0.0.3!

Practice as many words and phrases as you like, for as long as you like.
Hit Ctrl-C or Ctrl-D to quit.

Toisto tracks how many times you correctly translate words and phrases.
When you correctly translate a word or phrase multiple times in a row,
Toisto will not quiz you on it for a while. The more correct translations
in a row, the longer words and phrases are silenced.

Translate into Dutch:
Punainen
> rood
✅ Correct.

Translate into Dutch:
Harmaa
> bruin
⚠️ Incorrect. Please try again.
> grijs
✅ Correct.

Translate into Finnish:
Paars
> violetti
✅ Correct.

Translate into Finnish:
Groen
> virea
⚠️ Incorrect. Please try again.
> vihrea
❌ Incorrect. The correct answer is "Vihreä".

How it works

Toisto presents words and phrases in Dutch and Finnish for you to translate. For each word or phrase, Toisto counts how often you translate it correctly in a row. So each word or phrase has its own streak. When you translate a word or phrase correctly, increasing its streak, Toisto will silence the word for a while. The longer the streak, the longer a word or phrase is silenced.

When you stop the program (hit Ctrl-C or Ctrl-D), progress is saved in a file named .toisto-progress.json in your home folder.

Developer guide

The information below is aimed at people who (want to help) develop Toisto.

How to prepare

Clone the repository:

$ git clone https://github.com/fniessink/toisto.git

Create a virtual environment, activate it, install the dependencies and install Toisto in development mode:

$ cd toisto
$ python3 -m venv venv
$ . venv/bin/activate
$ pip install -r requirements-dev.txt
$ pip install -e .

How to test

Run the unit tests as follows:

$ green
.................

Ran 17 tests in 0.305s using 8 processes

OK (passes=17)

To run the unit tests and get a coverage report, use:

$ green -r

How to check quality

Run mypy to check for typing issues:

$ mpypy src tests
Success: no issues found in 12 source files

Run Pylint to check for linting issues:

$ pylint src tests

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

How to release

Update the version number in pyproject.toml.

Create the distribution files by running:

$ python -m build

Upload the distribution files to PyPI by running:

$ twine upload dist/*

Tag the commit and push it:

$ git tag vX.Y.Z
$ git push --tags

Software documentation

Decks

Decks are located in src/toisto/decks in the form of JSON files. The format of the JSON files is as follows:

[
    {"fi": "Viikonpäivät", "nl": "De dagen van de week"},
    {"fi": ["Mikä päivä tänään on?", "Mikä päivä on tänään?"], "nl": "Welke dag is het vandaag?"}
    {"singular": {"fi": "Päivä", "nl": "De dag"}, "plural": {"fi": "Päivät", "nl": "De dagen"}},
]

Each deck is a list of entries. There are two types of entries:

  1. A translation entry. Translation entries are a mappings with exactly two language key-value pairs. The key is a language identifier. Currently only "fi" for Finnish and "nl" for Dutch are supported. Each language identifier has a value that is either a string or a list of strings. The values are words, phrases, or sentences in the language indicated by the key.
  2. A noun entry. The entry is a mapping with singular and plural as keys and translation entries as values. It represents a noun with singular and plural versions in both Finnish and Dutch.

Toisto uses the entries to generate quizzes. Currently, two types of quizzes are generated:

  1. Quizzes to translate a phrase from Dutch to Finnish and vice versa. Toisto quizzes the user in both directions, Finnish-Dutch and Dutch-Finnish. If the language value is a list, Toisto uses all items as question and as answer. So both "Mikä päivä tänään on?" and "Mikä päivä on tänään?" are asked as question and both are accepted as correct answer for the quiz "Welke dag is het vandaag?"
  2. Quizzes to singularize a plural noun or pluralize a singular noun. Users are only asked to singularize and pluralize nouns in their practice language, not their native language.

Spaced repetition

Toisto uses a very simple implementation of a spaced repetition algorithm. Toisto does not make assumptions about how many words the user wants to practice per session or per day. It only keeps track of how many times in a row a specific word or phrases is translated correctly. When a word or phrases is translated correctly twice or more in a row, the word is silenced for a while. The longer the streak, the longer the word is silenced. The exact amount is determined by a S-curve with a maximum value of 90 days. Whenever the user makes a mistake the streak is reset to 0.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Toisto-0.0.3.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

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

Toisto-0.0.3-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file Toisto-0.0.3.tar.gz.

File metadata

  • Download URL: Toisto-0.0.3.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.0

File hashes

Hashes for Toisto-0.0.3.tar.gz
Algorithm Hash digest
SHA256 71da57e8825d0eb5a2aff517d2edea1cd1fdabf5695bcbdece569b1c9504f829
MD5 4e850bc5ae8e4451c5fa2e76456680f4
BLAKE2b-256 222fe04f42f9299eedf4545b38b65b4ebc11feb5718c91a371d06ddcdb5d793e

See more details on using hashes here.

File details

Details for the file Toisto-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: Toisto-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.0

File hashes

Hashes for Toisto-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 83a717caead9fc4d2e7b8743444ba42a001ce87a379520279ae6927f46d7efd7
MD5 8eb0b237a151f1816f5daaad48ab3104
BLAKE2b-256 1c842f5488ce453369d7d72dec7ca915b0736278f4fddba1e5cfc8797723e8b4

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