-
Notifications
You must be signed in to change notification settings - Fork 285
Add thai keyboard distance #513
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
Conversation
Thanks for great contribution. |
I agree to that suggestion. |
- Fix: According to the current distance algorithm, the keyboard layout should be a 2D array (in this case, 4 rows x N columns) - Try "๘"-"๙" and "๙"-"๐", they should have different distance values. - Fix: The proposed layout is actually a modified TIS 820-2531 (not 2538 one, see docstring)
Thai digit zero (๐) shouldn't be "next to" Thai digit nine (๙). Their distance should be different from the distance between, say, Thai digit eight (๘) and Thai digit nine (๙).
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.
@ppirch I have committed my proposed code, please kindly check if I understand your algorithm correctly.
I basically changed the keyboard layout array from 1D to 2D.
Since the distance between Thai digit eight and nine should be different from the distance between Thai digit nine and zero.
These two pairs are both next to each other in 1D array, but it's not the case for 2D keyboard layout.
A new test case also added to illustrated this.
I also changed the constant names to refer to a modified TIS 820 2531 instead. Since that's more reflected the content inside the array.
Sorry, I made a mistake in reverting the merge. Reverting the revert, and this PR is safely restored. Thanks @ppirch again for the code. |
What does this changes
Add function for calculate euclidean distance between two Thai characters on QWERTY Layout Keyboard