-
-
Notifications
You must be signed in to change notification settings - Fork 133
refactor(web): begin implementation of quotient-path convergence via SearchQuotientCluster 🚂 #14949
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
base: epic/autocorrect
Are you sure you want to change the base?
refactor(web): begin implementation of quotient-path convergence via SearchQuotientCluster 🚂 #14949
Conversation
User Test ResultsTest specification and instructions User tests are not required Test Artifacts
|
6ddd57f to
9068e40
Compare
1eaf922 to
ddf9a58
Compare
9068e40 to
b8457ec
Compare
228d93a to
f3fc256
Compare
f3fc256 to
a6e14c5
Compare
a6e14c5 to
a03bc15
Compare
02b9293 to
96a4b99
Compare
a03bc15 to
3f199ce
Compare
3fe8645 to
de3d86c
Compare
3f199ce to
0e70658
Compare
0e70658 to
72798ba
Compare
f5f2c1c to
2521e83
Compare
2521e83 to
c316ece
Compare
eaac92f to
403721b
Compare
c316ece to
23cba38
Compare
403721b to
fbe4bec
Compare
23cba38 to
258e213
Compare
1d44f26 to
6306f5e
Compare
237741f to
cff287f
Compare
bd5e4d9 to
7e1b6f4
Compare
This is to prepare for corrections from alternate tokenizations that could result from fat-fingering whitespace keys or similar effects. Build-bot: skip build:web Test-bot: skip
…ration unit tests
7e1b6f4 to
d3857a1
Compare
| * manage the search-space(s) for text corrections within the engine. | ||
| */ | ||
|
|
||
| import { QueueComparator as Comparator, PriorityQueue } from '@keymanapp/web-utils'; |
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.
Can we please directly use QueueComparator?
| import { QueueComparator as Comparator, PriorityQueue } from '@keymanapp/web-utils'; | |
| import { QueueComparator, PriorityQueue } from '@keymanapp/web-utils'; |
| import { SearchNode, SearchResult } from './distance-modeler.js'; | ||
| import { generateSpaceSeed, InputSegment, PathResult, SearchQuotientNode } from './search-quotient-node.js'; | ||
|
|
||
| const PATH_QUEUE_COMPARATOR: Comparator<SearchQuotientNode> = (a, b) => { |
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.
| const PATH_QUEUE_COMPARATOR: Comparator<SearchQuotientNode> = (a, b) => { | |
| const PATH_QUEUE_COMPARATOR: QueueComparator<SearchQuotientNode> = (a, b) => { |
| readonly lowestPossibleSingleCost: number; | ||
|
|
||
| /** | ||
| * Constructs a fresh SearchSpace instance for used in predictive-text correction |
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.
| * Constructs a fresh SearchSpace instance for used in predictive-text correction | |
| * Constructs a fresh SearchSpace instance for use in predictive-text correction |
| * @param baseSpaceId | ||
| * @param model |
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.
| * @param baseSpaceId | |
| * @param model | |
| * @param inboundPaths |
| * has fat-finger data available, which itself indicates that the user has | ||
| * corrections enabled. | ||
| */ | ||
| get correctionsEnabled(): boolean { |
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.
| get correctionsEnabled(): boolean { | |
| get correctionsEnabled(): boolean { |
| }); | ||
|
|
||
| it('handles case where tail token is split into three rather than two', function() { | ||
| it.skip('handles case where tail token is split into three rather than two', function() { |
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 guess the skipped tests (in this and the other files) will be re-enabled in one of the following PRs?
| * | ||
| * Created by jahorton on 2025-10-20 | ||
| * | ||
| * This file defines the predictive-text engine's SearchSpace class, which is used to |
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.
Shouldn't this be ?
| * This file defines the predictive-text engine's SearchSpace class, which is used to | |
| * This file defines the predictive-text engine's SearchQuotientCluster class, which is used to |
| * | ||
| * Created by jahorton on 2025-10-29 | ||
| * | ||
| * This file defines tests for the SearchSpace class of the |
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.
| * This file defines tests for the SearchSpace class of the | |
| * This file defines tests for the SearchQuotientCluster class of the |
This PR introduces a new implementation of the
SearchQuotientNodetype -SearchQuotientCluster. TheSearchQuotientClustertype is designed to represent cases where two or moreSearchQuotientNodeinstances represent the same total range of user input, as described in #15104's description as them "converging". In such cases, extending the search space by new input proceeds in exactly the same manner, regardless of which parent space is the original source. It's notably more efficient to cluster the paths together.If it helps, reference https://github.com/keymanapp/keyman/blob/change/web/relocate-search-quotient-test-utils/web/src/engine/predictive-text/worker-thread/docs/correction-search-graph.md#the-searchquotientcluster-type. Each "codepoint length" block in that graph is its own
SearchQuotientCluster, as well as the final, "destination" version visualized there.Also note that
SearchQuotientClusterdirectly reflects aTokenizationSubset(as described in #15140) - any of the paths leading to the cluster will correct to words of the same length, representing the same keystroke range from the user. Use of this type thus allows us to build a singleContextTokenizationinstance to represent the convergence of these paths - both for correction-search operations and for preservation of state after application of a suggestion arising from it.Build-bot: skip build:web
Test-bot: skip