Last active
August 19, 2022 18:40
-
-
Save jenchanws/5c8dedb826c775fc2a1521c9b9104ea9 to your computer and use it in GitHub Desktop.
Raw stroke dictionary (needs `plover-dict-commands` and `plover-stitching` plugins)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}:/}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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