Skip to main content

Python dictionaries support for Plover

Project description

Add support for Python dictionaries to Plover.


A Python dictionary is simply a single module with the following API:

# Length of the longest supported key (number of strokes).

# Lookup function: return the translation for <key> (a tuple of strokes)
# or raise KeyError if no translation is available/possible.
def lookup(key):
    assert len(key) <= LONGEST_KEY
    raise KeyError

# Optional: return an array of stroke tuples that would translate back
# to <text> (an empty array if not possible).
def reverse_lookup(text):
    return []

For example save the following code to



def lookup(key):
    assert len(key) <= LONGEST_KEY, '%d/%d' % (len(key), LONGEST_KEY)
    if SHOW_STROKE_STENO != key[0]:
        raise KeyError
    if len(key) == 1:
        return ' '
    return key[1]

Then add it to your dictionaries stack as you would a normal dictionary.

Now, if you stroke STR*, then the next stroke will be shown verbatim (untranslated), e.g. -T STROEBG TP-R KW-GS STROEBG KR-GS S STR* STROEBG outputs: the stroke for "stroke" is STROEBG.

Release history


  • fix ./ test handling
  • fix default implementation of reverse_lookup to return a list (not a tuple)


  • update to Plover’s latest API

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for plover-python-dictionary, version 0.5.10
Filename, size File type Python version Upload date Hashes
Filename, size plover_python_dictionary-0.5.10-py3-none-any.whl (5.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size plover_python_dictionary-0.5.10.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page