plover.steno – Steno data model¶
This module deals with the fundamental concept in stenography: the
A stroke is a combination of keys all pressed at once; an
outline is a series
of strokes performed in succession.
Many Plover actions deal with steno strokes, and this will be especially useful to authors of system and dictionary plugins.
Steno notation refers to the way steno strokes are written textually, such as on the paper tape or in dictionaries. Each stroke is written as a concatenation of several keys, sometimes with a hyphen.
Steno notation is also sometimes referred to as RTF/CRE (Rich Text Format with Court Reporting Extensions) notation, named after the dictionary format that popularized it.
Each steno system has a
steno order, or a canonical ordering of all the keys
on the layout. For most systems, this is the ordering of the keys from left to
right, starting with the left bank, then the thumb keys, then the right bank,
but others may use a different order. Well-formed steno notation must have
all keys in steno order.
The full list of keys and rules for expressing strokes in steno notation are defined for each steno system. See plover.system – Steno systems for more information.
Combinations of keys can be expressed by concatenating the letters representing
them; for example,
-T together can be written
W- together can be written
KW-. All but one hyphen is
removed to separate the left and right bank keys, but the hyphen may be
omitted completely if a stroke includes certain keys, such as the
SET, or the
Strokes are often written with a hyphen, because without one it may not be
fully clear which side each key is on. For example, the
refer to either left-hand
P- or right-hand
K-PT respectively is unambiguous. Strokes that consist entirely of left
bank keys may be written without a hyphen, e.g.
KW- can be written
Some strokes may still be resolvable when not completely well-formed, i.e. the hyphen is in the wrong place or doesn’t exist when it should, or the keys aren’t fully in steno order, but it’s not guaranteed to work.
When a part of a stroke represents a number we don’t write the number key; instead, we replace the letter keys with the corresponding numbers.
For example, to express the stroke represented by pressing the
T- keys together with the number bar (
#) in steno notation, we write
S- represents the number
If a stroke consists only of a number key, or none of the other pressed keys
represent numbers, we still write the number key. For example,
are both valid steno notation, since
-R does not represent a number, but
#P- is not (write
We use the stroke delimiter,
/, to separate successive strokes in a single
outline. For example, to write the 3-stroke outline for
New York Times, we
TAOEUPLS are all separate strokes, but
/ indicates that they are written in sequence.
The character used to separate successive strokes. This is equivalent to
- class plover.steno.Stroke(steno_keys)¶
An object representing a single stroke.
steno_keysis a list of steno keys that does not necessarily have to be in steno order; this class is responsible for rearranging them and constructing the steno notation.
- steno_keys: List[str]¶
A sorted list of the steno keys that compose this stroke.
- rtfcre: str¶
The normalized (or canonical) steno notation for this stroke.
The canonical steno notation for a stroke has the following properties:
All of the keys are in steno order
There is a hyphen only if at least one key on the right bank is pressed and this key is not an implicit separator
Number keys are written as numbers rather than using the number key (for example,
- is_correction: bool¶
Whether this stroke is a
correctionstroke, and can be used to undo the previous stroke.
- plover.steno.normalize_steno(strokes_string: str) Tuple[str] ¶
- plover.steno.sort_steno_keys(steno_keys: List[str]) List[str] ¶
Return a new list of steno keys, sorted based on the current system’s steno order.
- plover.steno.sort_steno_strokes(strokes_list: List[Tuple[str]]) List[Tuple[str]] ¶
Return a new list of outlines sorted by the number of strokes first, and then the length of each stroke (number of keys).