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.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.dev3.tar.gz
(15.0 kB
view hashes)
Built Distributions
Close
Hashes for plover_stroke-1.0.0.dev3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4385fc67370f8b678532fcdfaea0b1c8b991188925b549c9ae34a0a85dee702e |
|
MD5 | 123a0e1d018dbc195a85e75dcc7dc2f4 |
|
BLAKE2b-256 | cb81f53704e801b508ccb536d464ff1f7999cc59a5b199923ee0d17843e7818c |
Close
Hashes for plover_stroke-1.0.0.dev3-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c06fffea903c472c7c236b6f7bedaa3a830f065e36eb28a8fe24b1bd9efff603 |
|
MD5 | 8ed200683bf5b45087d54b0a848f7835 |
|
BLAKE2b-256 | f891befe0bc6579be7e19603732f0e9061ad9b19736a77639c596b20e4ca6177 |
Close
Hashes for plover_stroke-1.0.0.dev3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64390dd5f6df4d7c76f78ac723a59e737782d0c6cd1b46ba01dac61cdb57b53a |
|
MD5 | d32af2079bd7d1273be1570b6e898308 |
|
BLAKE2b-256 | 6e574fe7a1f076c4a93a83c740c22e8b4720bca5f9ae4903767c80d2e4df3193 |
Close
Hashes for plover_stroke-1.0.0.dev3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2005b3c7abbb3a34ba551514bd400b98a2c61214d31781cda9acebc9dd2837d |
|
MD5 | 76120d7561d36938afd5a3cedfdcd4bf |
|
BLAKE2b-256 | 0785ed1a2bf1152f6d62d02e15fadef0f825fd57f1ba5b42931192ca6e565f2c |
Close
Hashes for plover_stroke-1.0.0.dev3-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7da8bfda9abe536dbb08137e818f81993c6d2f6f236c12a6b96fb70f9ce41638 |
|
MD5 | b3019416b874649b97b869d40bd4a86e |
|
BLAKE2b-256 | f2aa2aa2cb40e1875395ef004d9b99e41332c9e656171cd00c869fee7e0e2a0a |
Close
Hashes for plover_stroke-1.0.0.dev3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f77a6d8b97c1734dbdca0ccf8af6b91ec11baecb44db7fe07496e0bc3b0a420 |
|
MD5 | c8f5babb064c451621a8c744106c20d7 |
|
BLAKE2b-256 | c571665254dcebf59d604e88bae42b15d9311797c7301895aebdaf97e92ab0a1 |
Close
Hashes for plover_stroke-1.0.0.dev3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0854468f897f124205f5361ea58fb63d37bf6e5661305d535252046a20391d89 |
|
MD5 | c24754ed5eb909e95e5b7f234f628e28 |
|
BLAKE2b-256 | af38743b8449843ef9c253114170b4e0fe33c83b755cbe8272f95186b1890333 |
Close
Hashes for plover_stroke-1.0.0.dev3-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4d987ad4be5359fdb2a3ed350f26c47acded3b91d48454dbad86c8bc7f673a8 |
|
MD5 | c8f3b2fb4aa7b017c71336f4147569a8 |
|
BLAKE2b-256 | 8e731f7d26a79f41a3f19c44b8c0af2a30a16ff3f31fb314bd9bd3c49ac32935 |
Close
Hashes for plover_stroke-1.0.0.dev3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a346fa06c0a6029e9e9dac34a51f1195af01e4f8208e0612a94966eb8547fc4d |
|
MD5 | ec40e060f870dc66a5640b8c3559577a |
|
BLAKE2b-256 | 22eea2ecda0448f50ceb7e4a979cddd2b435ca8d4aea0e089fb03fcfb34cbc50 |
Close
Hashes for plover_stroke-1.0.0.dev3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7d04f8075f2649c498cbb65c3ca0a1ae3a9c66f3ff57a3938270b9b587da4ed |
|
MD5 | 90fa0c02f1d8fbb3a57137a93a7f0189 |
|
BLAKE2b-256 | d7460fd9f9fe196e8199b4834368e2abd7507cbb0d72767e56466d88bd9556ab |
Close
Hashes for plover_stroke-1.0.0.dev3-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9858774eeaeddbc7d46a855a30ebb5f5198d6df3fe08a566e8e977c8c8671896 |
|
MD5 | 042e928e01a75bde0b522fd18d4e93eb |
|
BLAKE2b-256 | 9d1acd2649fb380044c685d7748ab5f11d67da472240b9071407efd8d9ee4b9f |
Close
Hashes for plover_stroke-1.0.0.dev3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f28a825585304c1571aa03a61e08f1f07c765f6f3d7ec7faa007c6a4c6d312ee |
|
MD5 | ceca368aa04e372d7c15eec374bbcbc8 |
|
BLAKE2b-256 | eb888a2a8bffcfa561076a42b6c55ff55cb6302dcd42449569e30c0191d74296 |