-
-
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(web): check for low-probability exact + exact-key correction matches 📚 #11876
Conversation
User Test ResultsTest specification and instructions User tests are not required Test Artifacts
|
3632a12
to
7779125
Compare
a1ed21f
to
c6dd3bf
Compare
c6dd3bf
to
ae02e7d
Compare
I am tempted to make you feel better by saying "there, their, they're"... Interestingly, I've seen other users who love this. |
I was actually thinking something similar, making it a configurable option. |
|
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.
I think this LGTM; I haven't reviewed the changes to the tests in detail as my flight is about to start descent and I wanted to get this in before that!
} | ||
|
||
const directEntries = rootTraversal.entries; | ||
// `Set` requires Chrome 38+, which is more recent than Chrome 35. |
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.
If we are moving away from ES5 (#11881), does that bump our minimum version of Chrome?
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.
It does. This PR's main content was written months ago, before we were looking at directly dropping it. #11881 isn't yet merged, either.
if(keyed(tuple.correction.sample) == keyedPrefix) { | ||
if(predictedWord == truePrefix) { | ||
tuple.matchLevel = SuggestionSimilarity.exact; | ||
keepOption = this.toAnnotatedSuggestion(tuple.prediction.sample, 'keep', models.QuoteBehavior.noQuotes); |
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.
It would be good to add a comment for this and the next 3 lines of code because it's not entirely obvious what's happening here, even with the comments on ll.426-428
…-through-traversal' into fix/web/low-probability-exact-matching
Noticed this while working on focused unit tests for the followup to #11940: even with this PR in place, we're not currently auto-selecting something like The probability-ratio requirement should probably only apply to suggestions within the same "similarity tier". If it's a lower tier, we should probably straight-up ignore its probability component for the sum used in the thresholding ratio. |
Changes in this pull request will be available for download in Keyman version 18.0.75-alpha |
One long-time pet peeve of mine when it comes to auto-correct: it should never correct away from a perfectly-valid word of the language. Even if
it's
is a more common word in English thanits
, I believe thatits
should be left in place. (I find it quite the pain on iOS, as I've had to fight iOS to leaveits
before.)Even if we were to auto-correct away, we should ensure that
its
is, at least, easily accessible on the banner as an option so that a user may at least prevent auto-correction that way. (Admittedly, iOS does present it... I probably need to adapt.) That is... we need to detect exact matches + exact-key matches and ensure they're always visible, with priority. This is something our engine currently doesn't do well, but thanks to #11869, we now have the perfect tool to remedy the issue.Secondly... the
ModelCompositor.predict
method is long and rather "monolithic". It'd be nice to spin off as much "keep"-related handling as possible into its own method.Unit tests for the new functionality will be added with #11944. Ideally, this PR should not be merged until all PRs in the sequence up to and including #11944 are ready to go.
@keymanapp-test-bot skip