Skip to main content

Plover Cycle Translations

Build Status PyPI - Version PyPI - Downloads linting: pylint

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")
  • words and their similar sounding proper nouns (e.g. "mark", "Mark", and "Marc")
  • differences in regional spelling for the same word (e.g. "colour", "color")

These variants can be defined with a single outline, rather than needing to remember all their respective outlines. Alternatively, all of their original outlines can be edited or overridden to be cycleable, so it will not matter which variant's outline you stroke, you will always have the option to cycle.

For some examples of cycleable list entries to add to your own steno dictionaries that encompass all of the points above, see here.

Install

  1. In the Plover application, open the Plugins Manager (either click the Plugins Manager icon, or from the Tools menu, select Plugins Manager).
  2. From the list of plugins, find plover-cycle-translations
  3. Click "Install/Update"
  4. When it finishes installing, restart Plover
  5. After re-opening Plover, open the Configuration screen (either click the Configuration icon, or from the main Plover application menu, select Preferences...)
  6. Open the Plugins tab
  7. 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".

If you have a particularly long list that you also want to cycle backwards through, you can use a "previous" selector stroke to do so, like:

"R*RB": "=CYCLE:PREVIOUS"

Cycleable dictionary entries are not limited to just single stroke outlines. Multiple stroke outline entries are also supported:

"ABG/SEL": "=CYCLE:axel,axle,axil"

Prefix and suffix entries are also supported:

"PW*EU": "=CYCLE:{bi^},by,buy,bye"

Non-text characters like emoji are also supported:

"H-PBD": "=CYCLE:👍,👎,👊"

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

  • Pytest is used for testing
  • Coverage.py and pytest-cov are used for test coverage, and to run coverage within Pytest
  • Pylint is used for code quality
  • Mypy is used for static type checking

Currently, the only parts able to be tested are ones that do not rely directly on Plover.

Run tests, coverage, and linting with the following commands:

pytest --cov --cov-report=term-missing
pylint plover_cycle_translations
mypy plover_cycle_translations

To get a HTML test coverage report:

coverage run --module pytest
coverage html
open htmlcov/index.html

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 --working-directory . --justfile test/justfile

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

Release files for plover-cycle-translations 0.5.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plover-cycle-translations 0.5.4
File Size Uploaded
plover_cycle_translations-0.5.4.tar.gz 22.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for plover-cycle-translations 0.5.4
File Interpreter ABI Platform
plover_cycle_translations-0.5.4-py3-none-any.whl Python 3 none any Details

Total release size: 44.1 kB

Release files / plover_cycle_translations-0.5.4.tar.gz

Download URL plover_cycle_translations-0.5.4.tar.gz
Size 22.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1e83b0c70037bfa95118ce91684f4799af0880f5378269cccee51f24edcbfc95
BLAKE2b-256 checksum
How to use checksums
59a6e4bf761cfb41388831b8ecfbd796d41f3f4712b6ffc530e9d1c2dca01311
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / plover_cycle_translations-0.5.4-py3-none-any.whl

Download URL plover_cycle_translations-0.5.4-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79dfb9a54b98f849306a4e3fb856af3f97f2b373d0bdc413c9bae6154026ecd5
BLAKE2b-256 checksum
How to use checksums
31610d99a18937c70924d82657ef12735e3d473d94d7e6d4504bbf6eba9baae8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.5.4 This release

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page