Skip to content

Instantly share code, notes, and snippets.

@jenchanws
Last active August 19, 2022 18:40
Show Gist options
  • Save jenchanws/5c8dedb826c775fc2a1521c9b9104ea9 to your computer and use it in GitHub Desktop.
Save jenchanws/5c8dedb826c775fc2a1521c9b9104ea9 to your computer and use it in GitHub Desktop.
Raw stroke dictionary (needs `plover-dict-commands` and `plover-stitching` plugins)
LONGEST_KEY = 1
def lookup(steno):
if len(steno) != 1:
raise KeyError
stroke = steno[0]
if stroke == "RA*U":
return "{plover:solo_dict:+raw.py}"
elif stroke == "RA*UZ":
return "{plover:solo_dict:+raw-tape.py}"
raise KeyError
LONGEST_KEY = 1
def lookup(steno):
if len(steno) != 1:
raise KeyError
stroke = steno[0]
if stroke == "*":
return "=undo"
elif stroke == "RA*U":
return "{plover:end_solo_dict}"
return f"{{:stitch:{stroke}:/}}"
from plover.system import *
from plover_stroke import BaseStroke
LONGEST_KEY = 1
class Stroke(BaseStroke):
pass
Stroke.setup(KEYS, IMPLICIT_HYPHEN_KEYS, NUMBER_KEY, NUMBERS)
def lookup(steno):
if len(steno) != 1:
raise KeyError
stroke = steno[0]
if stroke == "*":
return "=undo"
elif stroke == "RA*U":
return "{^}{plover:end_solo_dict}"
keys = [" "] * len(KEYS)
stroke = Stroke(stroke)
for key in stroke.keys():
keys[KEY_ORDER[key]] = key.replace("-", "")
keys = "".join(keys)
return f"{{^{keys}^}}\n{{^}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment