Skip to content

change(web): add lexical weighting to prediction search - #16600

Open
jahorton wants to merge 1 commit into
masterfrom
change/web/lexically-weight-prediction-search
Open

jahorton wants to merge 1 commit into
masterfrom
change/web/lexically-weight-prediction-search

Conversation

@jahorton

@jahorton jahorton commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Fixes: #16577

From 14.0 up until now, our correction-search focused on the minimum "correction distance" to a possible text correction, then performed prediction on top of that. This PR changes the search to integrate word-frequency weighting from models within the search, allowing us to optimize for the most likely predictions, rather than stopping at an intermediate point. There is no additional performace cost impact of note here - the probability associated with a correction's best prediction is already accessible O(1) with operations we've already been doing.

It is likely that this will help further mitigate issues with transposition handling noted in the user tests for #16450.

Build-bot: skip release:web,android,ios

User Testing

TEST_SMOKE: Use predictive text with Keyman for Android and check for any unusual and undesired behaviors.

TEST_TEH: Using Keyman for Android with SIL EuroLatin for English, type teh and verify that the shows up as a suggestion and is autoselected.

Fixes: #16577

From 14.0 up until now, our correction-search focused on the minimum "correction distance" to a possible text _correction_, then performed prediction _on top of that_.  This PR changes the search to integrate word-frequency weighting from models within the search, allowing us to optimize for the most likely predictions.  There is no additional performace cost impact of note here - the probability associated with a correction's best prediction is already accessible O(1) with operations we've already been doing.

It is likely that this will help further mitigate issues with transposition handling noted in the user tests for #16450.

Build-bot: skip release:web,android,ios
@keymanapp-test-bot

keymanapp-test-bot Bot commented Sep 17, 2026

Copy link
Copy Markdown

User Test Results

Test specification and instructions

  • TEST_SMOKE (OPEN)
  • TEST_TEH (OPEN)
Results Template
# Test Results

* **TEST_SMOKE (OPEN):** notes
* **TEST_TEH (OPEN):** notes

Test Artifacts

@keymanapp-test-bot keymanapp-test-bot Bot added this to the B19S2 milestone Sep 17, 2026
@github-actions github-actions Bot added web/ web/predictive-text/ change Minor change in functionality, but not new labels Sep 17, 2026

@mcdurdin mcdurdin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Base automatically changed from change/web/remove-tokenization-corrector to master September 18, 2026 13:08
@jahorton jahorton linked an issue Sep 18, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change Minor change in functionality, but not new has-user-test user-test-required User tests have not been completed web/predictive-text/ web/

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

change(web): improve optimization of prediction-generation

2 participants