Metadata-Version: 2.4
Name: plover_stroke
Version: 1.1.0
Summary: Stroke handling helper library for Plover
Home-page: https://github.com/benoit-pierre/plover_stroke
Author: Benoit Pierre
Author-email: benoit.pierre@gmail.com
License: GNU General Public License v2 or later (GPLv2+)
Project-URL: Source Code, https://github.com/benoit-pierre/plover_stroke
Project-URL: Issue Tracker, https://github.com/benoit-pierre/plover_stroke/issues
Keywords: plover
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Provides-Extra: test
Requires-Dist: pytest>=3.0.1; extra == "test"

# Plover Stroke

Helper class for working with steno strokes.

Usage:

``` python
# 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.1.0

* add `feral_number_key` support: when set to `True`, allow the number key
  letter anywhere when parsing steno (e.g. `18#`, `#18`, and `1#8` are all
  valid and equivalent, as per the RTF/CRE spec).


### 1.0.1

* fix exception in case of invalid keys mask


### 1.0.0

* drop `Stroke.xrange` and `Stroke.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` to `Stroke.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
