-
Notifications
You must be signed in to change notification settings - Fork 327
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
Allow 4-character abbreviations of mnemonic words ... #168
Conversation
ee306a0
to
732a4eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
R
Please give this another look for inclusion. |
This is now failing one specific test mnemonic. Checksum calculation fails. Let me see why that is.
|
I know why this fails, the logic to create a word language map is wrong. I'm glad this got caught before it made it in! Let me think on how to improve |
ba629ee
to
e50822d
Compare
This now passes all tests. Logic has been changed. Previously I normalized and sliced to 4 characters while constructing Instead, I am now using a nested for list comprehension that compares the full word language map against abbreviations, then flatten the resulting 2D list again. If there's a more elegant way of doing this, please share! Because abbreviations can match several languages, and then merely fail the checksum, I am now continuing the search through the languages when a checksum fails, rather than returning |
Please give this another look for inclusion. Also, please give feedback on whether changing the two |
Please give this another look for inclusion. If there are concerns, please raise them. |
Ping to get this considered for inclusion, please. |
... when using the
existing-mnemonic
workflow.This addresses #167
Choices made:
Because of the way the dict lookups are written, I decided to normalize to 'NFKC' and slice to 4 characters or less. The normalization is there so that combining Unicode characters work and the string doesn't get sliced to 3 visible characters.
I have no particular attachment to this way of handling it. If you'd rather not normalize and do a partial match on dict keys instead, I am game. If there's a third method you favor, ditto.
new-mnemonic
workflow has not been touched and still does a straight compare. One might discuss whether that workflow should allow abbreviations as well, but that might be a different PR.This code passes the test suite.