-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
feat(android): accepting a suggestion then adding punctuation should delete automatically added space #7163
Comments
I think some of the adjustments (and notes for future work) I have as part of #7205 may be helpful for this. See my notes starting here: keyman/common/web/lm-worker/src/model-compositor.ts Lines 159 to 177 in 6c50de9
A similar strategy could be used to detect if we'd tokenize without the space there - "if so, why add a word-breaking space"? |
In NaijaType I built in rules to my keyboard to address this with the most common punctuation: ,.!? Could it be a suggested block of code that keyboard-makers could add to their keyboards and customise as needed? |
@rowbory, yes this is a good idea. We'll consider this as part of any future solution. |
What if the LM would insert a kind of dead-key that gets ignored when a punctuation key follows and turns into space or whatever when any other key is typed? |
Yeah, some special marker might be a way forward? I'd include the space with the suggestion, but then have the following keyboard pseudocode:
|
This looks like a small issue, but, from a user point of view, it's a turn off. It is funny to press a backspace every single time a punctuation is added after a word is picked of the banner. If there is a voting system for this to be fixed/added, I'd like to vote for this one. Can we have this done soon as it was first posted two years ago? |
@MakaraSok I agree it is annoying. We'll put it into the 18.0 triage. We have not had anyone working on the predictive text module for a while. But as @jahorton is working on predictive text for v18, there is a good chance we can get onto this. |
... I just had an idea for it that shouldn't be terribly hard to implement for reversing the space. We could add a spot on returned suggestions for specifying whitespace deletion. The issue, though: which keyboard characters are punctuation, again? We'd need a way to say which characters trigger the auto-delete and which don't... which makes more sense on the model, rather than the keyboard. That opens up issues we'd definitely need to design for. I'm thinking a whitelist approach would be better than a |
What??? |
We're noticeably closer to this with recent improvements for 18.0, but we're not all of the way there yet. I forgot about this issue, so I kind of wrote it up again as #12013... though there are a few related ideas that don't perfectly match this issue documented there as well. |
My solution is the following kmn code:
The down side of this I notice when I have that keyboard running and I try doing something like typing I do like the idea of the prediction model spitting out a deadkey that turns into a space when anything but a space or list of "don't add a space before me" characters are typed. At least until anything is done in the engine the code above can be added to any keyboard to make it less annoying for end users. |
@jahorton This probably belongs to you, not sure if it fits in with your current work. We can triage together later. |
Is your feature request related to a problem? Please describe.
From a team review of the Keyman for Android UX (#7161)
When using a lexical model that inserts spaces after an accepted suggestion, it's annoying to have to press backspace before adding punctuation such as full stop.
Describe the solution you'd like
Ideally, delete the space before inserting the punctuation, then re-insert the space after the punctuation.
Unfortunately, this is probably not trivial to solve -- the keyboard itself does not know that the LM inserted the space, so it's not really possible right now to do a special case for punctuation in the keyboard code. Likewise, the LM has no control when the punctuation is typed, so it can't automatically delete the space in this situation.
Furthermore, this is language-specific behaviour: not all LMs insert spaces; some insert ZWSP, or nothing at all after a suggestion.
Per @jahorton: Will need predictive-text design work to properly addressed - pretty sure it’ll need language-specific (or script-specific) data to be defined on the lexical model.
Related issues
Keyman for Windows/macOS/Linux/iPhone/iPad/Android:
The text was updated successfully, but these errors were encountered: