Skip to main content

Command-line tool for learning foreign languages through reverse translation of word-based sentences

Project description

CrossRS

CrossRS is a command-line tool for improving language production skills through reverse translation exercises. Given a corpus in your target language, CrossRS translates sentences into a source language you already know and asks you to translate them back, reinforcing vocabulary and grammar through word-based spaced repetition. Because CrossRS uses GPT under the hood, you must have a paid OpenAI account and an API key to run it.

How It Works

CrossRS focuses on words sorted by their frequency in the corpus. You learn the most common ones first. Each study round:

  1. CrossRS picks a sentence containing the next word to learn.
  2. The sentence is translated into your source language and shown to you.
  3. You translate it back into the target language.
  4. CrossRS evaluates your translation and provides feedback — either a ✅ confirmation or a ❌ with a highlighted diff showing the minimal corrections needed.

Sentences you translate correctly on the first try are scheduled for a single review in 29 days 20 hours. Otherwise, they enter a spaced-repetition queue with reviews at 20 hours, 6 days 20 hours, and 29 days 20 hours before being marked as learned.

Installation

Install Python 3.13 or later and pipx, then run:

pipx install crossrs       # install
pipx upgrade crossrs       # upgrade
pipx uninstall crossrs     # uninstall

Initialize a New Language

Prepare a plain-text file that contains one sentence per line in the language you want to learn. For example, you can download a monolingual corpus from OPUS. Then run:

crossrs init <target-lang> <corpus>

<target-lang> is a language code (e.g., de, fr, uk), and <corpus> is the path to the corpus file.

Study a Language

crossrs study <target-lang> <source-lang> [--threshold T] [--model <GPT_MODEL>] [--api-key <OPENAI_KEY>]
  • <target-lang> — the language code you initialized earlier.
  • <source-lang> — the language you want sentences translated into (e.g., en).
  • --threshold / -t — the learnedness threshold for words (default: 3). A word is considered fully learned once it has appeared in this many learned sentences.
  • --model — the GPT model to use for translation and evaluation.
  • --api-key — your OpenAI API key.

Instead of passing --model and --api-key each time, you can set the environment variables CROSSRS_MODEL and CROSSRS_API_KEY.

View Your Progress

crossrs stats <target-lang> [--threshold T]

Displays:

  • Sentences: learned + in queue / total
  • Words: learned / total, with word-level coverage
  • Total rounds: the number of translation attempts so far

Other Commands

crossrs path <target-lang>               # show the path to the language data file
crossrs delete <target-lang> [--force]   # delete the language data file; use --force to skip the confirmation prompt

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

crossrs-0.1.0.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

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

crossrs-0.1.0-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file crossrs-0.1.0.tar.gz.

File metadata

  • Download URL: crossrs-0.1.0.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for crossrs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 00838582a479544a1c756d2a6d2f1174e46c4bac9e9f99c7b6ab200d2a334440
MD5 090640efaefb85ea0f7c090ab59f60d9
BLAKE2b-256 dbfe65963a18c7a846b9e95027f3c31a03b10104d55b80f184b5931a3c33bd2a

See more details on using hashes here.

File details

Details for the file crossrs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: crossrs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for crossrs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5110ba5e6a528c0cf9cc111bd87cd85ee68d435a12b6ed3a163e26f05d33a7ea
MD5 dbf7c8abd53e187b3db4ce4d49dc73b0
BLAKE2b-256 7b2841552e8d9c63d0e080681430ff8ea0251f811115945b5b0e1dd7ba823582

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