Skip to content

feat(web): add abstraction for main correction-search algorithm, leveraged types 🚂#15817

Open
jahorton wants to merge 2 commits intorefactor/web/extract-duplicate-result-filterfrom
feat/web/correction-search-abstraction
Open

feat(web): add abstraction for main correction-search algorithm, leveraged types 🚂#15817
jahorton wants to merge 2 commits intorefactor/web/extract-duplicate-result-filterfrom
feat/web/correction-search-abstraction

Conversation

@jahorton
Copy link
Copy Markdown
Contributor

@jahorton jahorton commented Apr 2, 2026

Finishing up the batch of work started in #15814, this PR enacts new type abstractions that will let us search for context corrections in new ways.

As mentioned in #15814...

To accomplish the goal of abstracting the core search mechanisms, work will proceed in the following manner:

  1. Relocate the code representing paths through the search graph (before making further changes).
  2. Properly return the type representing the critical metadata for processing partial + completed paths of the search graph.
  3. Prepare the search method for abstraction, extracting any code specific to the existing search pattern that may not work well when searching for corrections in alternative ways.
  4. Abstractify the actual search method and critical metadata types.

A new implementation of the abstract interfaces introduced here will come in #15818. Those changes will support correction-search over multiple tokens at once, allowing word-boundary corrections while prioritizing which token to search at any given time in support of completing a full phrase (possibly multiple tokens).

Build-bot: skip build:web
Test-bot: skip

@keymanapp-test-bot
Copy link
Copy Markdown

keymanapp-test-bot bot commented Apr 2, 2026

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

  • Web
    • KeymanWeb Test Home - build : all tests passed (no artifacts on BuildLevel "build")

@keymanapp-test-bot keymanapp-test-bot bot changed the title feat(web): add abstraction for main correction-search algorithm, leveraged types feat(web): add abstraction for main correction-search algorithm, leveraged types 🚂 Apr 2, 2026
@keymanapp-test-bot keymanapp-test-bot bot added this to the A19S26 milestone Apr 2, 2026
Comment on lines +36 to 38
export class TokenResultMapping implements CorrectionResultMapping<SearchNode> {
readonly matchingSpace: SearchQuotientNode;
readonly node: SearchNode;
Copy link
Copy Markdown
Contributor Author

@jahorton jahorton Apr 9, 2026

Choose a reason for hiding this comment

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

Note that for correction-search processes, we need access to the following data for results:

  • The object best representing the context-variation that led to the correction.
    • For tokens, that's SearchQuotientNode - each of which represents a given range of the context and possible edit sequences.
  • The corrections themselves.
    • For tokens, that's SearchNode, which represents the specific edits made and tracks the LexicalModel object that provides efficient correction + prediction lookup operations.

@jahorton jahorton force-pushed the refactor/web/extract-duplicate-result-filter branch from 30bb779 to 3ae0e4c Compare April 9, 2026 21:37
…raged types

Build-bot: skip build:web
Test-bot: skip
@jahorton jahorton force-pushed the feat/web/correction-search-abstraction branch from 6cedadc to eaf419f Compare April 9, 2026 21:39
@jahorton jahorton requested a review from ermshiperete April 9, 2026 21:52
@jahorton jahorton marked this pull request as ready for review April 9, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant