Stroke handling helper library for Plover
Project description
Plover Stroke
Helper class for working with steno strokes.
Usage:
# Setup:
from plover_stroke import BaseStroke
class Stroke(BaseStroke):
pass
Stroke.setup(
# System keys.
'''
#
S- T- K- P- W- H- R-
A- O-
*
-E -U
-F -R -P -B -L -G -T -S -D -Z
'''.split(),
# Implicit hyphen keys (optional, automatically
# deduced from system keys if not passed).
'A- O- * -E -U'.split(),
# Number bar key and numbers keys (optional).
'#', {
'S-': '1-',
'T-': '2-',
'P-': '3-',
'H-': '4-',
'A-': '5-',
'O-': '0-',
'-F': '-6',
'-P': '-7',
'-L': '-8',
'-T': '-9',
})
# Creating strokes:
Stroke(56)
# => KPW
Stroke(('-F', 'S-', '-S', 'A-', '*'))
# => SA*FS
Stroke('R-')
# => R
Stroke('L-')
# => invalid, raise a ValueError
# Methods:
s = Stroke('STK')
s.keys()
# => ('S-', 'T-', 'K-')
s.is_number()
# => False
int(s)
# => 14
s == 0b00000000000000000001110
# => True
# Strokes can be compared:
sorted(map(Stroke, 'AOE ST-PB *Z # R-R'.split()))
# => [#, ST-PB, R-R, AOE, *Z]
Release history
1.0.0 [unreleased]
- drop
Stroke.xrange
andStroke.xsuffixes
methods Stroke('')
now raise an exception (useStroke(0)
to create an empty stroke)Stroke.keys()
now return a tuple- fix corner case when parsing steno (
RR
->R-R
) - fix RTFCRE when numbers are involved (align with Plover's behavior)
- fix implicit hyphen handling when numbers are involved
- renamed
Stroke.isnumber
toStroke.is_number
- speed up implementation through a C extension
0.4.0
- fix stroke comparison
0.3.3
- fix
python_requires
package metadata
0.3.2
- first public release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
plover_stroke-1.0.0.dev1.tar.gz
(14.4 kB
view hashes)
Built Distributions
Close
Hashes for plover_stroke-1.0.0.dev1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66321a306fc3be372a7e7be36bdb413699a29d7df814516727dead8cdf737467 |
|
MD5 | 93d144119b605cffe888fbfd4aec7e03 |
|
BLAKE2b-256 | b67a42d9b42affe49f5691aabc5a902dde9251bb5dd38b73897d842cea31c179 |
Close
Hashes for plover_stroke-1.0.0.dev1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 845e72fe8e1294cd92bae9b4a822a685334dce8ba62119b8f35206935b4aa004 |
|
MD5 | 039a6c210da67f6b6c0e7d5fea4e782e |
|
BLAKE2b-256 | e687e43e2c7e5c8d6979e53a4583a45add7cd750fe9f664b9f9b1a076085b2e6 |
Close
Hashes for plover_stroke-1.0.0.dev1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f884b4654ff6b38a84acf471e1bcfa67c18904f88e7d4199962217d845d5b04 |
|
MD5 | 6a76cc16f62f835e4be3348685096793 |
|
BLAKE2b-256 | 62b26b2655bd3b3f1e3c2628f4e57989a67810abd722e164bfbb4b8a486f3ff8 |
Close
Hashes for plover_stroke-1.0.0.dev1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3e54b1d746a3a948fc522966fb0a0468755c9f5ad74295384a504c284d751aa |
|
MD5 | 8729b52b09c64d5aabaa379f9a49868b |
|
BLAKE2b-256 | bd4af725ef69f240644204ae74142a761da9c0da7a7dc94550656f4d7a30289e |
Close
Hashes for plover_stroke-1.0.0.dev1-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8ad5be35412d067b5b6cbc4863758d4a577ccac493e33ada7df467aa7a57233 |
|
MD5 | d215d041eabd436f50379f6f76086063 |
|
BLAKE2b-256 | 64e0889506c5bbed136e2b2890aafd2b493ad59e76e1c838b639441242d7d8b9 |
Close
Hashes for plover_stroke-1.0.0.dev1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8269a30435a4643d89a0c668ea722d66046afd63433dd6cb3a4a207f0e609d42 |
|
MD5 | 1fb036e03a89a7dc17849388557e2027 |
|
BLAKE2b-256 | 68c9250fe6efd099fec5369fc420b6a0e601f167d05a598cb7a6db08e725f466 |
Close
Hashes for plover_stroke-1.0.0.dev1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c81727a6ea6a513f8c1370fd3cea4d04750c7a4a3c57d365b8fbb2abfbde7a4 |
|
MD5 | 7cc0bcc9f93b4cc799658e7fb7ba38de |
|
BLAKE2b-256 | 30e1dea1f1dd0bec923c3dd3ac21cec3733d3a4603929b81bf476deaeb12f5b8 |
Close
Hashes for plover_stroke-1.0.0.dev1-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c74f3aaed11701434d03184e857cb0680b0b1ae498f71497c63f50d244d53165 |
|
MD5 | 05cd2cbabd55b24ce3b69227d254633d |
|
BLAKE2b-256 | 16ddef5500077e6155dcd5bdd7c03494ab715cf10ab15225c35c52f5d9ff7393 |
Close
Hashes for plover_stroke-1.0.0.dev1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d3d24496a87bcbaa4c97bee4135f061c866bbe2294bfd3c5655c3f8706e8c7d |
|
MD5 | f2a3a952d691ca3a46c5e1b45d388149 |
|
BLAKE2b-256 | f34e4ea2f96873389376a25c4232ceeef4b83402dc197025c424f1f3866ff081 |
Close
Hashes for plover_stroke-1.0.0.dev1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1e6cb6e555b3f38c807341d2029cc6404587bd5ec0ea5d3e96dff418e3be474 |
|
MD5 | 5bbd6e714ffc4638625343c9f3519832 |
|
BLAKE2b-256 | 935daf1997a87e988b890dd8a68b492721ed801afed7febcef7d976bf9f7fb3f |
Close
Hashes for plover_stroke-1.0.0.dev1-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56a3401919190e9ec5b055d993b19d1f9d36f1bdcb0bf07719de1d0ccb91b465 |
|
MD5 | bed769a290025222111e4855e9042bf7 |
|
BLAKE2b-256 | 548099041be29bafb7c1aa7d5ed3139fb72e78df065cd62e77edc3d9392eaab1 |
Close
Hashes for plover_stroke-1.0.0.dev1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93476a86ac867f2dc3144613203a55e4f0884209aee5ed921f7255c99492cf66 |
|
MD5 | f0a01a53f16388c656c3d62b76e8bec9 |
|
BLAKE2b-256 | fe0eb6e41a3b65296e24cfe6a75a05f45a993abcc75fd439822b0b41bc64378a |