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
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
Built Distribution
File details
Details for the file hmeg-0.1.5.tar.gz
.
File metadata
- Download URL: hmeg-0.1.5.tar.gz
- Upload date:
- Size: 26.1 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6b314944bb208fda8d02d7cf569609649e83a4984a400d58436dc8f4abec79d |
|
MD5 | a0c8498b1418037d953ddf005b89fbcc |
|
BLAKE2b-256 | dfd2f096660130730b9980d3e11c7d4917d5b14f304833ea8316a116b36c49cb |
File details
Details for the file hmeg-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: hmeg-0.1.5-py3-none-any.whl
- Upload date:
- Size: 56.3 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef02fa5454bde514e75478bf25674683361150d62bf1214f513d15fed973f713 |
|
MD5 | 54c555e8b7255a598c924fa9787a5840 |
|
BLAKE2b-256 | a85d40813212e440b98a25fe824e963ed28f4077e19bf11dd9855b70ecf8492e |