Skip to content

refactor(web): extract token-search result duplicate-filtering method 🚂#15816

Open
jahorton wants to merge 8 commits intochange/web/return-search-token-mappingfrom
refactor/web/extract-duplicate-result-filter
Open

refactor(web): extract token-search result duplicate-filtering method 🚂#15816
jahorton wants to merge 8 commits intochange/web/return-search-token-mappingfrom
refactor/web/extract-duplicate-result-filter

Conversation

@jahorton
Copy link
Copy Markdown
Contributor

@jahorton jahorton commented Apr 2, 2026

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 refactor(web): extract token-search result duplicate-filtering method refactor(web): extract token-search result duplicate-filtering method 🚂 Apr 2, 2026
@keymanapp-test-bot keymanapp-test-bot Bot added this to the A19S26 milestone Apr 2, 2026
@jahorton jahorton force-pushed the change/web/return-search-token-mapping branch from 8666dcd to b4b40bd Compare April 9, 2026 21:36
@jahorton jahorton force-pushed the refactor/web/extract-duplicate-result-filter branch from 30bb779 to 3ae0e4c Compare April 9, 2026 21:37
@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
@keyman-server keyman-server modified the milestones: A19S26, A19S27 Apr 14, 2026
}

protected buildEdgesForNodes(baseNodes: ReadonlyArray<SearchNode>) {
protected buildEdgesFromResults(priorResults: ReadonlyArray<TokenResultMapping>) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
protected buildEdgesFromResults(priorResults: ReadonlyArray<TokenResultMapping>) {
protected buildEdgesFromResults(priorResults: ReadonlyArray<TokenResultMapping>): SearchNode[] {

let bestCorrectionCost: number;
const correctionPredictionMap: Record<string, Distribution<Suggestion>> = {};
for await(const match of getBestMatches(searchModules, timer)) {
for await(const match of getBestMatches(searchModules, timer, initTokenResultFilterer())) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
for await(const match of getBestMatches(searchModules, timer, initTokenResultFilterer())) {
for await(const match of getBestTokenMatches(searchModules, timer)) {

Comment on lines +625 to 626
filter(result);
return result;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this correct? We don't do anything with the return value of filter, so this calls seems a bit pointless here, but I'm probably missing something.

Suggested change
filter(result);
return result;
return filter(result) ? result : null;

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.

3 participants