-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I "run" my python dictionary to get it to output a json? #4
Comments
Not sure what I can support about this. I think you have a few options
|
Yes, I do apologize. More of a Python question really. I'm on Win 11. Plover is in the usual place, C:\Program Files\Open Steno Project\Plover. Perhaps once I can confirm the way to do this it could be added to the readme page? I have a dictionary for Hindi I'd like to share, but right now I'd have to provide command line instructions for people to use it. Hoping to just have a JSON. |
Update: I managed to get it to work. Here are the steps in case anyone else stumbles on this: Windows 11. Python install on system, but Plover uses it's own...
(I tried piping to a file, but my JSON output had unicode characters so I got an encoding error. However copying the output in the terminal and pasting it still worked even though the terminal wouldn't display the the unicode characters properly.) |
Some day it would be easier. |
Having an issue with the above steps. Did something change in this library? I tried the steps above and I'm now getting a "Duplicate Keys" error. More detail: What I'm confused about is if there was a problem with the .py dictionary file I would expect to get an error when the dictionary is loaded in plover. I'm not getting any error there. I'm only getting this error when I attempt to output to a json file in a command window. Here's the code error from my command prompt: |
The problem is it's nontrivial to detect duplicate keys quickly. In order to detect it the program can list all the key-value pairs, but if it does every time Plover starts it would be slow. On the other hand when printing out the JSON dictionary, it needs to list all the key/values anyway, so it might as well do. |
I guess I don't understand why that control about duplicates is needed given that Plover doesn't fail with the same .py file. That said, if the error could tell me what the duplicate was I could attempt to modify the .py file to ensure my python logic doesn't produce any duplicate stroke definitions. As it is, I don't get the list, just the error. And no feedback on what I would need to modify to avoid the error and get a print out. |
I modified it to just print a warning of some example duplicating entries instead of an error. |
Oh awesome! Thank you. |
I tried:
python dictionary.py
But I get an error: ModuleNotFoundError: No module named 'plover'. I tried a few things, but I'm not super familiar with python so not sure what I'm missing.
Thank you.
The text was updated successfully, but these errors were encountered: