Define multiple translations in a single steno outline and cycle through them.
Project description
Plover Cycle Translations
This Plover extension plugin contains a macro that allows you
define multiple translations in a single outline, and then cycle through them
Alt-Tab- or IME-style using a "selector stroke". It covers similar
ground to Plover's retro_toggle_asterisk
macro, but is broader in
scope than just toggling between an outline and its asterisk-flagged equivalent
(e.g. "HAOEU": "high"
and "HAO*EU": "hi"
).
Cycling translations can be helpful for disambiguating between homophones (words that are pronounced the same but differ in spelling; e.g. "sent", "cent", and "scent"), or words and their similar sounding proper nouns (e.g. "mark", "Mark", and "Marc") with a single outline, rather than needing to remember all their respective outlines. See here for examples of "multinyms" that could form the basis of some dictionary entries.
Install
Pre-Plover Plugin Registry inclusion (Current)
git clone git@github.com:paulfioravanti/plover-cycle-translations.git
cd plover-cycle-translations
plover --script plover_plugins install --editable .
Where
plover
in the command is a reference to your locally installed version of Plover. See the Invoke Plover from the command line page for details on how to create that reference.
Then:
- When it finishes installing, restart Plover
- Open the Plover Configuration screen (either click the
Configuration icon, or from the main Plover application menu, select
Preferences...
) - Open the Plugins tab
- Check the box next to
plover_cycle_translations
to activate the plugin
Post-Plover Plugin Registry inclusion (Future)
- In the Plover application, open the Plugins Manager (either click the Plugins
Manager icon, or from the
Tools
menu, selectPlugins Manager
). - From the list of plugins, find
plover-cycle-translations
- Click "Install/Update"
- When it finishes installing, restart Plover
- After re-opening Plover, open the Configuration screen (either click the
Configuration icon, or from the main Plover application menu, select
Preferences...
) - Open the Plugins tab
- Check the box next to
plover_cycle_translations
to activate the plugin
Usage
Using the "sent", "cent", and "scent" example above, the outlines for them in Plover theory are:
"SEPBT": "sent"
- indicative of a phonetic (how the word sounds) reading of "sent""KREPBT": "cent"
- indicative of an orthographic (how the word is spelled) reading of "cent", using the fingerspelled "C"KR
chord"SKREPBT": "scent"
- orthographic, similar to "cent"
If you wanted to standardise on the phonetic SEPBT
outline for all three
words, you could use this plugin to create a dictionary entry as follows:
"SEPBT": "=CYCLE:sent,cent,scent"
This will output "sent" when stroked. You then use a "selector stroke" to cycle to the next word in the comma-separated list of words, in the order they are defined. An example of a "selector stroke" dictionary entry would be:
"R*R": "=CYCLE:NEXT"
As you cycle through the word list, each outputted word gets replaced with the
next word entry. Once you hit the end of the list, the cycle begins again: in
the example above, if you stroke =CYCLE:NEXT
when you have output "scent",
it will be replaced with "sent".
Development
Clone from GitHub with git and install test-related dependencies with pip:
git clone git@github.com:paulfioravanti/plover-cycle-translations.git
cd plover-cycle-translations
python -m pip install --editable ".[test]"
If you are a Tmuxinator user, you may find my plover-cycle-translations project file of reference.
Python Version
Plover's Python environment currently uses version 3.9 (see Plover's
workflow_context.yml
to confirm the current version).
So, in order to avoid unexpected issues, use your runtime version manager to make sure your local development environment also uses Python 3.9.x.
Testing
Currently, there is not enough logic in the plugin that doesn't depend on internal state of the extension class to justify extraction to other modules. Since the only parts of the plugin able to be tested are ones that do not rely directly on Plover, automated testing with Pytest has not really been possible.
Run linting and type checking with the following commands:
pylint plover_cycle_translations
mypy plover_cycle_translations
If you are a just
user, you may find the justfile
useful during
development in running multiple code quality commands. You can run the following
command from the project root directory:
just
Deploying Changes
After making any code changes, deploy the plugin into Plover with the following command:
plover --script plover_plugins install --editable .
Where
plover
in the command is a reference to your locally installed version of Plover. See the Invoke Plover from the command line page for details on how to create that reference.
When necessary, the plugin can be uninstalled via the command line with the following command:
plover --script plover_plugins uninstall plover-cycle-translations
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 plover_cycle_translations-0.2.0.tar.gz
.
File metadata
- Download URL: plover_cycle_translations-0.2.0.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2817fe362afe647b27b1a6c61ce39d7b802e5e8d7abc3db469405e9393201eae |
|
MD5 | d7142d61ea2217d342ece7c595da00b8 |
|
BLAKE2b-256 | d4d9c819e802bc599c8ce73848ea184305e259640761d81f232f3a8511daf48e |
File details
Details for the file plover_cycle_translations-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: plover_cycle_translations-0.2.0-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bab7af91f0384e2b26513da64a46330de5e8bafe742a8625339e92131b42f581 |
|
MD5 | bf08ad81b5247c6bf530eaba5c3764b9 |
|
BLAKE2b-256 | e99290a096c1db3de2556e9b81ed40facc80612d5413038bc0f36d64cc8be941 |