keymanapp / keymanapp/keyman

feat(web): accepting a suggestion then adding punctuation should delete automatically added space 🚂

Open
#7,163 15 comments 0 reactions 1 assignee Assigned to @jahorton View on GitHub
epic-autocorrect feat web/ web/predictive-text/
Dominant language
Pascal
Stars
534
Forks
143
Avg merge
2d 10h
Merged PRs (30d)
113

Description

**Is your feature request related to a problem? Please describe.**

From a team review of the Keyman for Android UX (https://github.com/keymanapp/keyman/issues/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:**
- Device: Samsung A90 5G
- OS: Android 12
- Keyman version: 15.0.269-stable

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.