Clean-room ZMK steno engine with trie/DAWG dictionary
Find a file
afiqzudinhadi 23439a52f7 Parse Plover number strokes: digits = number bar + positional key
parse_stroke silently dropped digit characters, so number strokes
collapsed onto their letter-only bitmasks: "12K" and "K" both parsed
to K → first-wins dedup let "12K"→"12:00" clobber "K"→"can" (and 297
more core entries: -R→are eaten by 12-R→XII, -S→{^s} by 2-S→2s...).
Digits now map per Plover: 1=S- 2=T- 3=P- 4=H- 5=A- 0=O- 6=-F 7=-P
8=-L 9=-T, all implying #. Collisions: 298 → 0; 300 union keys and
161 translations recovered. Verified: all 262,309 entries byte-exact,
42,000-vector host round trip 0 mismatches.
2026-07-03 20:08:45 +08:00
dicts Scaffolding: ZMK module structure, Kconfig, DTS, behavior driver 2026-07-02 02:04:28 +08:00
dts Scaffolding: ZMK module structure, Kconfig, DTS, behavior driver 2026-07-02 02:04:28 +08:00
include/dt-bindings/zmk Scaffolding: ZMK module structure, Kconfig, DTS, behavior driver 2026-07-02 02:04:28 +08:00
src Debug: log lookup decisions + transport results 2026-07-03 15:50:58 +08:00
tests v4 union split-section dictionary: both full dicts, zero trimming 2026-07-03 01:28:31 +08:00
tools Parse Plover number strokes: digits = number bar + positional key 2026-07-03 20:08:45 +08:00
zephyr Scaffolding: ZMK module structure, Kconfig, DTS, behavior driver 2026-07-02 02:04:28 +08:00
.gitignore Scaffolding: ZMK module structure, Kconfig, DTS, behavior driver 2026-07-02 02:04:28 +08:00
CMakeLists.txt Own DEFLATE decoder replaces zlib dependency 2026-07-03 11:37:19 +08:00
Kconfig Own DEFLATE decoder replaces zlib dependency 2026-07-03 11:37:19 +08:00
LICENSE Scaffolding: ZMK module structure, Kconfig, DTS, behavior driver 2026-07-02 02:04:28 +08:00
README.md Scaffolding: ZMK module structure, Kconfig, DTS, behavior driver 2026-07-02 02:04:28 +08:00

zmk-steno-engine

Clean-room stenography engine for ZMK Firmware. Dictionary-based lookup with multi-stroke support, optimized for nRF52840 flash constraints.

Status: Early development — basic single/multi-stroke lookup works, formatter not yet implemented.

Features

  • Standard 23-key steno layout
  • Sorted-array dictionary with binary search lookup
  • Multi-stroke support with configurable timeout
  • All-up chord detection
  • HID keyboard output (ASCII)
  • Build-time dictionary compilation from Plover JSON
  • Test dictionary included for development

Building

Add as a ZMK module in your west.yml:

manifest:
  remotes:
    - name: zmk-steno-engine
      url-base: https://github.com/afiqzudinhadi
  projects:
    - name: zmk-steno-engine
      remote: zmk-steno-engine
      revision: optimize-dict

Enable in your .conf:

CONFIG_STENO_ENGINE=y

Use in your keymap:

#include <dt-bindings/zmk/steno_keys.h>

/ {
    keymap {
        steno_layer {
            bindings = <
                &steno STENO_SL  &steno STENO_TL  &steno STENO_PL  ...
            >;
        };
    };
};

Dictionary Compiler

# Compile test dictionary
python3 tools/compile_simple.py dicts/test.json -o steno_dict.bin --stats

# Compile Plover dictionary (trimmed)
python3 tools/compile_simple.py plover-main.json -o steno_dict.bin --max-entries 120000 --stats

License

PolyForm Noncommercial 1.0.0