openstenoproject/plover

Plover reports 'invalid steno' when importing dictionary for alternate steno layout

Closed this issue ยท 10 comments

Describe the bug

Plover reports 'invalid steno' when importing dictionary for alternate steno layout.

To Reproduce

Steps to reproduce the behavior:

  1. Install Plover v4.0.0.dev10. Configure Plover to use TX Bolt for the TinyMod.
  2. Ensure that the plover-plugins-manager is on the latest version (currently 0.7.0)
  3. Import https://github.com/mkrnr/plover_regenpfeifer (I did this both on the command-line and through the GUI plugin configuration)
  4. Remove all dictionaries (just to be safe).
  5. Under Config -> System, switch to Regenpfeifer
  6. Attempt to import regenpfeifer_main.json.
  7. Confirm that Plover raises a huge number of errors (on the order of tens of thousands) with reports like:
ValueError: invalid steno: 'A*EFPSN'

Expected behavior

Plover recognizes the new keyboard layout in which Z is replaced with N
updates its definition of what the valid steno order is
and validates dictionary entries against this new steno order.

Screenshots

image

Operating system

  • OS: Debian 11 (bullseye)
  • Plover Version: 4.0.0.dev10+120.g4394ef1

Hardware

I am using a TinyMod via TX Bolt.

Probably the relevant thing to share here is that under Configure -> Machine, I can confirm that the Keymap does show that Z was remapped to N:

image

I tried poking around https://github.com/benoit-pierre/plover_stroke and https://github.com/openstenoproject/plover/blob/master/plover/system/__init__.py to see if there's a clear indication of the steno order not getting updated and wasn't able to find a clear root cause. That's probably due to my dated background in C and lack of familiarity with Plover's codebase.

Something like A*EFPSN definitely seems like it follows valid steno order when Z is replaced with N, so it seems like plover's definition of steno order isn't getting updated to reflect this.

cc @mkrnr

Discord chat where I tried to get some more context on what might be happening here:
https://discord.com/channels/136953735426473984/281185832637825025/970168385612677151

It's worth noting that the commit "switch to plover_stroke" removes 5- and 0- as implicit number keys. b90ea14

Maybe if the same change is done to https://github.com/mkrnr/plover_regenpfeifer/blob/master/plover_regenpfeifer/system.py it could be fixed? (I didn't test it.)

mkrnr commented

@user202729 was exactly right. I applied the same change to system.py in plover_regenpfeifer and it now works for me with Plover version 4.0.0.dev10+120.g4394ef1 (macOS Monterey, M1)

@jladdjr you can try out version 0.0.3 of plover_regenpfeifer from the plugins manager.

@mkrnr - thanks for looking into this!

I went into the plugins manager and was able to update regenpfeifer to 0.0.3. I'm now seeing a new error:

image

It may just be because the engine didn't update, but I'm also seeing the original error for translations that seem valid:

image

That looks more like an error that only happen in the old version rather than the new one (did you restart Plover?)

After restarting I still seeing a number of errors, but it seems like these might actually be valid:
image

Looks like the main issue here was fixed. Thanks @user202729 and @mkrnr for the super-fast help!

mkrnr commented

Yeah, those errors are valid. The code I used to generate this dictionary definitely needs some love.

@mkrnr - this is probably off topic for this thread, but I've been curious about how the dictionary was built. What's been the general approach you've taken. If you had some cycles to make improvements, where would you start?

My wife was born in Germany and I'm about a month into learning German, myself. Trying to get plugged in with German steno. I'm at about 80 wpm with English steno. Would love to be able to practice steno in both languages! Thanks for getting this project started!

mkrnr commented

I wrote a blog post in 2019 explaining my approach. I'll contact you on Discord regarding the improvements.