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.dev2.tar.gz
(14.6 kB
view hashes)
Built Distributions
Close
Hashes for plover_stroke-1.0.0.dev2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 871a36a0b3d7738c34fd2dccc30a993540f23799bd7674a1e17fc3d2a757fe4d |
|
MD5 | 410ed33c80b8d26d136c40bd52788872 |
|
BLAKE2b-256 | 5b5d873f612c27f80563bb1b9b19fff1177455265e9db3b47f29d0ecb8e2d396 |
Close
Hashes for plover_stroke-1.0.0.dev2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55f6be6033063d2ffb990ceb65df090de02c975efb84acebffe71dac6ccdb9c8 |
|
MD5 | ae9513625ca1bbb59f85a9f521c21cf1 |
|
BLAKE2b-256 | 9934c3e0f20fe1feb91ca41a96088d1e5ba451e02f94165426897843a3355962 |
Close
Hashes for plover_stroke-1.0.0.dev2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81c937b3150aeeddc2e1a9a2142ba7f3c9521215f2073eaea11f0ffef42f363d |
|
MD5 | 5ad02d1d61f1c3ef2298e692ef64aa3a |
|
BLAKE2b-256 | 9802eda88f72c152b6e0946a0cd3b151b36b3096cf1de37d5698d3eca3437692 |
Close
Hashes for plover_stroke-1.0.0.dev2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b352314ba370b37c3421b0e5b443b5dfce9b6b4e7d86495303ef08391e804f32 |
|
MD5 | 988970bfb905f31fc55e6d0472d2478b |
|
BLAKE2b-256 | 8f2384c86a702d43f4f8eb0803b33602c5fa1dc1f06775945bd2df1d1609bd2a |
Close
Hashes for plover_stroke-1.0.0.dev2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33342b57297cf4aa77aeb57ddad154bc6b7ce00df6ceed0229f79551b8c7a290 |
|
MD5 | 0516f13be205b88fb328db33cd582a99 |
|
BLAKE2b-256 | 689827f9fcaedcb852b9a27dec2fffd2bceeaf6f4cba9293cf0fa341f540ae44 |
Close
Hashes for plover_stroke-1.0.0.dev2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c8d31bc35f856bd72d48cee26817840901fa3cd842e30727a3489e8d0fb86f1 |
|
MD5 | cd0aade7effac29fa3b9a12c83356d1c |
|
BLAKE2b-256 | 82f53c7c2483fb29f020bdafcbd4f7ce8faab8eab704bcfa6485604231eddfb8 |
Close
Hashes for plover_stroke-1.0.0.dev2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31184b994175acb78c5d3c5e7d0db15c5a023c5aea579e8e53357895b0444d4d |
|
MD5 | 9a366fe3c2ca374f0524bb1efcf3f691 |
|
BLAKE2b-256 | 52f314325dcd18895a6f823b1d83cf11a135c9c8677531da3b18dd670482727c |
Close
Hashes for plover_stroke-1.0.0.dev2-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf488ac3bfedc8c85c1ef075b8141c44cce25a20500a5fe3ca4e0e4e9bc47305 |
|
MD5 | 04ed8883bafe2be6ee4edc83dddbcc24 |
|
BLAKE2b-256 | 8a7291b9dc27a6c91f7c0c31ec14df8d47cbedebc10a77b303f9bed317db552a |
Close
Hashes for plover_stroke-1.0.0.dev2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d85ce0f8fc4e4fd2039eba7aa87d1de411deded934afd2de0d4484939c23f46 |
|
MD5 | 713fd9d66e7df91d634db6ee92932b92 |
|
BLAKE2b-256 | e2e4a51f8c9590057180622deabe02001921e113f99732e5499b6d870768e820 |
Close
Hashes for plover_stroke-1.0.0.dev2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2f677965b36f92d02525cd0935eff95a4ef64835d199468c3d79fba85fab22a |
|
MD5 | a6fc8ddbea102a282d5d2bad4ca4101b |
|
BLAKE2b-256 | 8ec276bd828ee9d9088f56fc191512475bb409edf22a6e5fa7b512de04a08ea2 |
Close
Hashes for plover_stroke-1.0.0.dev2-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 454490402bbb762fd5b74f7f11c14841c65cdd27b7373e2b59ba2188dbe9fb26 |
|
MD5 | 85b9a502874fb6445416dabcd50433a3 |
|
BLAKE2b-256 | 049b5b614be3026e057f442dfbd62aeff805dfbeb9d454a78b71b8e9104f270c |
Close
Hashes for plover_stroke-1.0.0.dev2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58b43570d0de94b4eaefecebb1cae0c72758338f670875b341fa78f8b815e2c0 |
|
MD5 | f8844d5e6397b94649dc8a382ba2551b |
|
BLAKE2b-256 | e210e3ab19116f00b259a1841ef3a7f81cc448930559f52cc99b289205949a3a |