Download the JSON dictionary folkets_sv_en_public.json from here.
Store the file in one of the following locations:
- Global installation (recommended):
/home/<YOUR_USERNAME>/.config/swedishelf/- This makes the dictionary available system-wide for all your swedishelf sessions. (You may need to create the.configandswedishelfdirectories if they don't exist) - Local installation: Place the file in the directory where you plan to run
swedishelf- The dictionary will only be available when running swedishelf from that specific directory.
Install ffplay (part of the FFmpeg package). The following example uses Ubuntu:
sudo apt update
sudo apt install ffmpeg -yVerify that ffplay is installed correctly:
ffplay -versionInstall swedishelf:
pip install swedishelfEnjoy!
Download the JSON dictionary folkets_sv_en_public.json from here.
Store the file in one of the following locations:
- Global installation (recommended):
C:\Users\<YOUR_USERNAME>\AppData\Roaming\swedishelf\- This makes the dictionary available system-wide for all your swedishelf sessions. (You may need to enable viewing of hidden folders to accessAppData, and create theswedishelfdirectory if it doesn't exist) - Local installation: Place the file in the directory where you plan to run
swedishelf- The dictionary will only be available when running swedishelf from that specific directory.
Before installing swedishelf, you need to enable UTF-8 support on Windows:
- Open Control Panel → Clock and Region → Region
- Click the Administrative tab → Change system locale
- Check the box for "Beta: Use Unicode UTF-8 for worldwide language support"
- Restart your system
After restarting your system, install swedishelf:
pip install swedishelfEnjoy!
To use swedishelf, simply run the command swedishelf in your terminal. This will start an interactive session where you can practice your Swedish language skills.
You can customize your experience with the following options:
-dor--dic: Specify dict file, will use default dict if not specified.-nor--num: Number of questions for this round.-mor--mute: If mute, will not play audio.-cor--choices: Number of choices for each question, the bigger, the harder.-vor--version: Show version and exit.--help: Show CLI help and exit.
Here's an example of how to use swedishelf with the default settings, open a terminal and run:
$ swedishelfThis will start a session with 20 questions, using the default dictionary file.
Swedishelf searches for the dictionary file in the following priority order:
- Custom dictionary path (specified with
-dor--dictoption) - Current working directory (the directory where you run the
swedishelfcommand) - System-wide user config directory (varies by operating system):
- Linux:
/home/<YOUR_USERNAME>/.config/swedishelf/ - Windows:
C:\Users\<YOUR_USERNAME>\AppData\Roaming\swedishelf\
- Linux:
A: The audio of the question you just answered is playing, and swedishelf is downloading the audio for the next question at this time without blocking. The download duration depends on the network conditions. If you run the program with the -m or --mute option, this delay will not occur.
If you'd like to contribute to swedishelf, please fork the repository and submit a pull request with your changes. You can also report issues or suggest new features on the issue tracker.
Swedishelf is licensed under the MIT License. See the LICENSE file for more information.