Skip to main content

Generator of exercises for practicing speaking for language learning.

Project description

hmeg

Help me, Erik Gunnemark -- library for generation of exercises for practicing of some basic speaking constructs. The (very hopeful) idea is that mastering these blocks can help with faster speaking and constructing more complex sentences.

The exercises are generated randomly and thus can occasionally come out as grammatically or semantically strange.

But as long as the sentence is not abusive and grammatically correct I assume that it is a proper exercise. With the goal to practice quickfire translation into Korean, where element of surprise can facilitate better memorization.

Usage

Command line

Update file hmeg.conf to select the grammatical topic and number of exercises and then execute:

python hmeg_cli.py

You can also specify command line arguments to define configuration file, topic, and or number of generated exercises.

  • Run with custom configuration file (notice the run keyword)
python hmeg_cli.py run --config="custom/configuration/file.toml"
  • Run with custom topic and number of exercises
python hmeg_cli.py run -n 15 -t "Have, Don’t have, There is, There isn’t / 있어요, 없어요"
  • You can use partial name of the topic. In that case all topics, that contain the specified string will be used.
python hmeg_cli.py run -n 15 -t "있어요, 없어요"
python hmeg_cli.py run -n 15 -t "there is"
  • List available topics described in the specified configuration file (optional)
python hmeg_cli.py list -c hmeg.conf
  • Print help for the arguments or specific command
python hmeg_cli.py --help
python hmeg_cli.py run --help
python hmeg_cli.py list --help

Python code

from hmeg import utils, ExerciseGenerator, load_minilex


num_exercises = 10  # number of randomly generated exercises for selected topic

utils.register_grammar_topics()
vocab = load_minilex()  # load words from the Minilex.

exercises = ExerciseGenerator.generate_exercises(
    topic_name="While / -(으)면서", num=num_exercises, vocab=vocab
)
print("\n".join(exercises))

Format of exercises and vocabulary

The library supports extensible and configurable templates for generation of exercises as well as customizable vocabulary.

The built-in exercises topics and vocabulary can be found in the hmeg/topics/ and hmeg/vocabs/minilex.toml

See folder docs for more details regarding description of format for exercises and vocabulary.

Why I made this library

First of all, few words about the naming of this library.

Erik Gunnemark was a pre-Internet era hyper-polyglot, who was able to translate from >20 languages. He is an author of the book "The Art and Science of Learning Languages" co-authored with Amorey Gethin. Among other things the book contains idea of a Minilex, a few hundred core words, picked based on the author's experience with learning multiple languages. Those words are considered to be important and cover a lot of situations.

As I am having lots of struggles with learning to speak Korean (>10 years), I was thinking about having additional exercises for speaking drills. And being a fan of the "crawling before walking" I was thinking that in order to speak full-length sentences, the smaller and simpler grammatical structures and phrases need to be internalized first.

I tried ChatGPT for getting exercises, but it produced quite repetitive output. And it was harder for me to control structure of exercises and restrict the vocabulary. So I decided to make my own exercise generator with flexible vocabulary and exercises.

Additionally, normally we do not need to use too many words to express ourselves so that our passive vocabulary much larger than the active one. Meaning that it can be ok to focus on a proper usage of core words and grammatical structures. But proper choice of words to rely upon is not that simple. This is where Minilex might be useful as it is based on the experience of the professional language learners.

However, Minilex is not the only option. Therefore, library was designed in such a way that dictionary can be switched depending on the user's goals. A good alternative to Minilex could be Basic English or specialized subset of words eg for medicine or engineering.

Lastly, the library naming is a plain reference to Star Wars :)

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

hmeg-0.1.3.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

hmeg-0.1.3-py3-none-any.whl (39.7 kB view details)

Uploaded Python 3

File details

Details for the file hmeg-0.1.3.tar.gz.

File metadata

  • Download URL: hmeg-0.1.3.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.6 Linux/6.8.0-76060800daily20240311-generic

File hashes

Hashes for hmeg-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1901db85b69e415ff1ecb3d10e58f016d20dbd16f3e48f466853223645ebdec1
MD5 c8444c1a0dda560f5c362ef2befd1336
BLAKE2b-256 556af00c60dd64257433a47ac5ea8cd0310de786df1d8f7b7c894aadb9ede2c0

See more details on using hashes here.

File details

Details for the file hmeg-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: hmeg-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 39.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.6 Linux/6.8.0-76060800daily20240311-generic

File hashes

Hashes for hmeg-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6c03d2afe9907dbd6fcf31b2ae860016c895139507e0f48fb031e885ae6d2376
MD5 ae54f577ec9ee423cc6a59194b5f6536
BLAKE2b-256 7011654e6cb64afdca48cf8883f549ecb591f1281a1c4e87eb28ff7699505762

See more details on using hashes here.

Supported by

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