mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-28 19:27:44 +00:00
Merge branch 'refactor/web/create-default-keep' into change/web/context-token-init
This commit is contained in:
commit
92a67bee08
2 changed files with 4 additions and 6 deletions
|
|
@ -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]);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue