change(web): track the base correction for generated predictions 📚
This PR serves to facilitate autocorrect.
After some brainstorming and design work, I've determined that a suggestion's underlying correction will be an important factor in deciding whether or not to enable the suggestion for automatic application. While it is possible to recompute some of the properties after the fact, the logic will be much more straightforward if we properly track each prediction's underlying correction from the outset.
While making the change, I remembered a comment from one of my recent PRs: https://github.com/keymanapp/keyman/pull/11424#discussion_r1619739920
Where else would this type be used?
(In regard to lexical-p, correction-p, etc)
We're able to more cleanly compute these values now. Additionally... we don't really need to emit them during standard use, though they are useful sometimes when debugging... so I added a flag that can be used to turn them off. Allowing this to be toggled by Keyman Engine for Web would require additional work, but it's at least a start. (I don't think they'll actually be needed outside of the worker, even with active autocorrect.)
@keymanapp-test-bot skip
User Test Results
Test specification and instructions
User tests are not required
Test Artifacts
- Android
- Developer
- iOS
- Keyboards
- Web
- Windows
Changes in this pull request will be available for download in Keyman version 18.0.70-alpha