bug(web): epic/boundary-correction does not properly model transpositions 🔪
- Dominant language
- Pascal
- Stars
- 534
- Forks
- 143
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 113
Description
See: #16450
As epic/boundary-correction will also be removing the `LegacyQuotientSpur` class, which is where the current transposition-handling code resides, we'll need to adapt #16450's contents to better model how the search quotient graph is constructed, placing them where appropriate within its specialized node types.
Suspected development path needed:
https://github.com/keymanapp/keyman/blob/45e3df9822d6444c5f0c0d0f47818ca52ea96e3a/web/src/engine/predictive-text/worker-thread/src/main/correction/legacy-quotient-spur.ts#L54
As any individual SearchQuotientNode may have multiple parent nodes and/or grandparent nodes in epic/boundary-correction, we'll need to adjust this. The core idea _is_ the same, though - we apply the _local_ inputs after the _grandparent_ path state, then append the _parent_ inputs.
So, we'd want to capture _all_ grandparent sources and request node-path forwarding from them. We'd also want a way to remember _which_ parent quotient nodes follow from which grandparent quotient nodes - likely via some sort of lookup table or hash map. And, of course, a way to remember which grandparent nodes each SearchNode passed through. (So, SearchNode -> grandparent node it came from -> allowed parent quotient node(s) -> the input(s) to transpose.) `.spaceID` values may prove useful here for linking everything together.
Contributor guide
Research direction
Start with web/src/engine/predictive-text/worker-thread/src/main/correction/legacy-quotient-spur.ts at the referenced transposition-handling code, then compare the requirements in #16450 with the boundary-correction node types. Trace how SearchQuotientNode parent and grandparent paths are constructed, including spaceID links. Done means transpositions work after LegacyQuotientSpur is removed and all relevant grandparent sources, parent relationships, and inputs are preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100