openstenoproject/plover

customisable character-replacement modes, e.g. ASCII-only

casperdewith opened this issue · 2 comments

request

A mode that replaces certain single characters (or character combinations, if that’s doable at run-time) by certain strings, right before they are output. This mode can be toggled on or off with a dictionary entry.

examples

When using Plover in an application that does not support all Unicode characters, a user could enable an ASCII-only mode that they might have defined as follows:

  • (en dash) becomes --
  • (ellipsis) becomes ...
  •   (no-break space) becomes (space)
  • ĉ becomes cx
  • ế becomes e^'
  • etc.

alternatives

The alternative would be to define an entire new dictionary with all the ASCII characters filtered out. This is not ideal.

implementation ideas

I don’t know yet where this should be implemented. Perhaps in the system. Or in a whole new place. Since the user needs to be able to toggle the character-replacement layer with a dictionary entry, the mode might need to be defined as a macro.

You can already implement it with https://pypi.org/project/plover-dict-commands/ ? You need to do it per entry though.