Skip to content

Conversation

@jahorton
Copy link
Contributor

This PR serves to implement SearchQuotientCluster.merge() in full. If two halves of a previous .split() operation are passed in, they should be fully remerged - into a single, refused SearchQuotientNode segment.

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

@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Jan 29, 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): implement SearchQuotientCluster merging feat(web): implement SearchQuotientCluster merging 🚂 Jan 29, 2026
@keymanapp-test-bot keymanapp-test-bot bot added this to the A19S21 milestone Jan 29, 2026
@jahorton jahorton force-pushed the change/web/add-same-edge-detection branch from 1f4897f to 56d7a8f Compare January 29, 2026 18:58
@jahorton jahorton force-pushed the feat/web/cluster-merging branch 2 times, most recently from 407cb6d to edf4712 Compare January 29, 2026 19:01
@keyman-server keyman-server modified the milestones: A19S21, A19S22 Jan 31, 2026
@jahorton jahorton force-pushed the change/web/add-same-edge-detection branch 2 times, most recently from d4f3a18 to 1755556 Compare February 5, 2026 16:48
This PR serves to implement SearchQuotientCluster.merge() in full.  If two halves of a previous .split() operation are passed in, they should be fully remerged - into a single, refused SearchQuotientNode segment.

Build-bot: skip build:web
Test-bot: skip
@jahorton jahorton force-pushed the feat/web/cluster-merging branch from edf4712 to 6150186 Compare February 5, 2026 16:52
@jahorton jahorton marked this pull request as ready for review February 5, 2026 16:52
Comment on lines +196 to +197
thisTailSpaceIds.find((entry) => entry == space.inputSource.subsetId)
&& thisTailInputSource.end == spaceHeadInputSource.start;
Copy link
Contributor

Choose a reason for hiding this comment

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

May be better to use Array.some here. Theoretically space.inputSource.subsetId can be 0 in which case Array.find would also return 0 i.e. falsy, and so isOnSplitInput would be false even though it should be true. I'm pretty sure this can't happen in our implementation (even though I don't know why), but using Array.some would be cleaner IMO (or thisTailSpaceIds.find(...) !== undefined)

Suggested change
thisTailSpaceIds.find((entry) => entry == space.inputSource.subsetId)
&& thisTailInputSource.end == spaceHeadInputSource.start;
thisTailSpaceIds.some((entry) => entry == space.inputSource.subsetId)
&& thisTailInputSource.end == spaceHeadInputSource.start;

// a prior split; if we'd split, it'd be a SearchQuotientCluster on both
// ends.
if(space instanceof SearchQuotientSpur) {
const parentMerge = this.merge(space.parents[0]) as SearchQuotientSpur;
Copy link
Contributor

Choose a reason for hiding this comment

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

construct takes a SearchQuotientNode, so there's no need to cast to a SearchQuotientSpur.

Suggested change
const parentMerge = this.merge(space.parents[0]) as SearchQuotientSpur;
const parentMerge = this.merge(space.parents[0]);

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