How can I convert a RTF/CRE stroke string to Stroke object? #1224
-
# Do we have tags? The question is in the title. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
I don't think there's a function in Plover. Method 1. Use Benoit's new library plover-stroke. See the README for more documentation. Method 2. Use |
Beta Was this translation helpful? Give feedback.
-
Anyway, I think |
Beta Was this translation helpful? Give feedback.
-
Side note: To use from plover import system
from plover_stroke import BaseStroke
class Stroke_(BaseStroke): pass
Stroke_.setup(system.KEYS, {*system.IMPLICIT_HYPHEN_KEYS} & {*system.KEYS}, system.NUMBER_KEY, system.NUMBERS)
stroke_=Stroke_("STK") Or in an independent script: (without the overhead mentioned in #1292) from plover.system import english_stenotype as e
from plover_stroke import BaseStroke
class Stroke_(BaseStroke): pass
Stroke_.setup(e. ... ) Sometimes you would need to convert from plover.steno import Stroke
print(Stroke(stroke_.keys())) Note that if you use this in a Python dictionary, the |
Beta Was this translation helpful? Give feedback.
Anyway, I think
plover_stroke
is more robust thanplover_build_utils.testing.steno_to_stroke
. It also does not rely onplover.system
.