Merge branch 'refactor/web/create-default-keep' into change/web/context-token-init

This commit is contained in:
Joshua Horton 2026-04-07 08:22:10 -05:00
commit 92a67bee08
2 changed files with 4 additions and 6 deletions

View file

@ -171,11 +171,11 @@ export class ModelCompositor {
const deduplicatedSuggestionTuples = dedupeSuggestions(this.lexicalModel, rawPredictions, context);
// Needs "casing" to be applied first.
//
// Will also add a 'keep' suggestion (with `.matchesModel = false`) matching
// the current state of context if there is no such matching prediction.
const hasExistingKeep = processSimilarity(this.lexicalModel, deduplicatedSuggestionTuples, context, transformDistribution[0]);
// If no existing suggestion directly matches the user-visible version of
// the token, also add a 'keep' suggestion (with `.matchesModel = false`)
// matching it.
if(!hasExistingKeep) {
const baseTuple = createDefaultKeep(this.lexicalModel, context, transformDistribution[0]);

View file

@ -752,9 +752,7 @@ export function dedupeSuggestions(
/**
* This function checks for any suggestions that directly match the actual
* context in some manner and ranks suggestions accordingly. Additionally, if
* there is no such suggestion, a stand-in is generated and added to the list,
* though marked as "not matching the model".
* context in some manner and ranks suggestions accordingly.
*
* The suggestion "ranks", from highest to lowest:
* - the suggestion produces an exact match for the user's current text