Commit graph

5549 commits

Author SHA1 Message Date
Joshua Horton
01a0eeec19 change(web): renames precomputeTokenizationAfterInput to mapWhitespacedTokenization 2025-10-08 08:40:15 -05:00
Joshua Horton
98a40a3f64 change(web): clarify role of sliceIndex in token-merge, token-split tests 2025-10-06 16:47:51 -05:00
Joshua Horton
f1b8cb2457 docs(web): assertion -> assumption 2025-09-30 09:18:56 -05:00
Joshua Horton
e1e5ae24c5 change(web): attempt to improve nomenclature 2025-09-29 14:26:43 -05:00
Joshua Horton
8a6f4437cd fix(web): implement proper non-BMP handling within precomputeTokenizationAfterInput 2025-09-29 11:37:57 -05:00
Joshua Horton
c7e5559d1a Merge branch 'feat/web/tokenized-transform-assembly' into feat/web/boundary-shifting-transform-tokenization 2025-09-29 11:09:28 -05:00
Joshua Horton
f1ce917dc2 Merge branch 'feat/web/compute-merge-split-effects' into feat/web/tokenized-transform-assembly 2025-09-29 10:33:10 -05:00
Joshua Horton
978f9678a6 Merge branch 'feat/web/trace-insert-edits' into feat/web/compute-merge-split-effects 2025-09-29 10:32:00 -05:00
Joshua Horton
c477221e93 fix(web): implement traceInsertEdits non-BMP string handling 2025-09-29 10:31:30 -05:00
Joshua Horton
2e16e397d7 Merge branch 'feat/web/backward-slide-tokenization' into feat/web/trace-insert-edits 2025-09-29 10:29:55 -05:00
Joshua Horton
10ccc954ef feat(web): add non-BMP test for edge-window-slide suite 2025-09-29 10:27:25 -05:00
Joshua Horton
cf017acb1c Merge branch 'feat/web/build-token-aligned-edge-windows' into feat/web/backward-slide-tokenization 2025-09-29 10:23:50 -05:00
Joshua Horton
1ffed0991a fix(web): fix edge-window construction handling of non-BMP chars 2025-09-29 10:22:58 -05:00
Joshua Horton
6cdba4297b fix(web): patch up unit test 2025-09-25 15:28:59 -05:00
Joshua Horton
b17dc93f0d Merge branch 'feat/web/tokenized-transform-assembly' into feat/web/boundary-shifting-transform-tokenization 2025-09-25 15:22:02 -05:00
Joshua Horton
04abb5e2fc Merge branch 'feat/web/compute-merge-split-effects' into feat/web/tokenized-transform-assembly 2025-09-25 15:18:51 -05:00
Joshua Horton
b1a9e07ef3 feat(web): provide startOffset for detected splits based on start index within original token 2025-09-25 15:18:30 -05:00
Joshua Horton
686ce86082 fix(web): fix extended merges, splits 2025-09-25 15:17:37 -05:00
Joshua Horton
5bd7edbb28 Merge branch 'feat/web/trace-insert-edits' into feat/web/compute-merge-split-effects 2025-09-25 15:07:46 -05:00
Joshua Horton
d32a29f854 Merge branch 'feat/web/backward-slide-tokenization' into feat/web/trace-insert-edits 2025-09-25 15:07:03 -05:00
Joshua Horton
b7bc34d528 Merge branch 'feat/web/build-token-aligned-edge-windows' into feat/web/backward-slide-tokenization 2025-09-25 15:04:43 -05:00
Joshua Horton
414c6f12ab Merge branch 'feat/web/context-slide-deltas' into feat/web/build-token-aligned-edge-windows 2025-09-25 15:03:40 -05:00
Joshua Horton
ec76f0dd5f Merge branch 'refactor/web/source-input-vs-example-input' into feat/web/context-slide-deltas 2025-09-25 15:01:06 -05:00
Joshua Horton
6eedb2e7ab change(web): revert no-longer-valid change 2025-09-25 14:59:49 -05:00
Joshua Horton
5dc28b5492 refactor(web): track original ContextToken source properties + reform use of .exampleText 2025-09-25 14:51:57 -05:00
Joshua Horton
2b64a0857b docs(web): fix sourceText doc comment 2025-09-24 10:37:12 -05:00
Joshua Horton
602c74c6e5 feat(web): method now computes new tokenization pattern for original context 2025-09-22 12:26:10 -05:00
Joshua Horton
91f701b59f feat(web): support transform tokenization even when existing boundaries shift
Related-to: #14679

Build-bot: skip build:web
Test-bot: skip
2025-09-22 12:26:05 -05:00
Joshua Horton
97e51a5a5d change(web): construct alternate helper for assembly of tokenized transforms
This adds another helper designed to facilitate #14790 and is targeted to eventually replace our current `tokenizeTransform` method.  We're not quite ready to drop `tokenizeTransform` and its helpers yet, though.

Build-bot: skip build:web
Test-bot: skip
2025-09-22 09:37:23 -05:00
Joshua Horton
7362d36066 feat(web): add helper for aligning tokens after merges, splits
Relates-to: #14679

Build-bot: skip build:web
Test-bot: skip
2025-09-22 09:36:12 -05:00
Joshua Horton
9ffc093ac4 feat(web): add helper for tokenizing Transform.insert via tokenization of applied context
Relates-to: #14679

Build-bot: skip build:web
Test-bot: skip
2025-09-22 09:34:40 -05:00
Joshua Horton
b1d3899c55 feat(web): adds helper method applyContextSlide for updating context tokenization before applying inputs
Relates-to: #14679

Build-bot: skip build:web
Test-bot: skip
2025-09-22 09:31:54 -05:00
Joshua Horton
1b39e92c16 change(web): edgeSliceIndex => sliceIndex 2025-09-22 09:30:17 -05:00
Joshua Horton
987de6ec27 docs(web): add docs for buildEdgeWindow helper types 2025-09-22 09:26:54 -05:00
Joshua Horton
8d4197d70f change(web): hoist changes motivated by later work 2025-09-22 08:52:49 -05:00
Joshua Horton
c43b02329d feat(web): add empty-context unit test 2025-09-19 12:28:41 -05:00
Joshua Horton
943f93294c feat(web): build token-aligned edge windows
These windows are designed for use in detecting tokenization shifts both at the start and the end of the context.

Relates-to: #14679

Build-bot: skip build:web
Test-bot: skip
2025-09-19 10:55:45 -05:00
Joshua Horton
fcc843e9b0 feat(web): adds method to determine the change to context resulting from a context window slide
To be explicit:  the method is designed to compare the context after applying
a context transition's edit with the context state after a window slide takes
effect, but before the next transition's edit takes effect.

Build-bot: skip build:web
Test-bot: skip
2025-09-19 09:28:11 -05:00
Joshua Horton
012dcaeee9 refactor(web): differentiate between true and represented inputs for context tokens
To be up-front, this is looking ahead significantly to epic/dict-breaker (#12142) concerns.  The core idea here:  each token should mark which part of the current context it represents - and the best data for the job happens to be the original, true transforms.

With epic/dict-breaker and other possible work that would faciltate considering alternative tokenizations, it is quite possible the original source transform(s) for a tokenization may not actually be represented within that tokenization's input set.

Consider:  if the spacebar appears as a fat-finger alternate for a letter key, we may wish to model an alternate tokenization where we actually _used_ that keystroke as a whitespace instead of a standard letter.  The resulting whitespace token shouldn't have the original letter key's transform as part of its represented inputs for such a case.

Build-bot: skip build:web
Test-bot: skip
2025-09-19 09:27:17 -05:00
Joshua Horton
f7e291a7c3 feat(web): add option to disable transpose edits
Tokens in the active context should not be transposable, so this commit adds an option that permits disabling transpose edits during edit-distance calculation.

Build-bot: skip build:web
Test-bot: skip
2025-09-10 10:52:43 -05:00
Joshua Horton
7ebfbfe54e refactor(web): move static computeDistance to standalone helper
The main goal of this commit is to allow computeDistance to operate properly with both ClassicalDistanceCalculation and SegmentableDistanceCalculation. For now, context alignment via computeAlignment will continue to use the former edit-distance calculation type, but the goal is to convert to use of the latter and its support for 'split' / 'merge' edit operations in the near future.

Build-bot: skip build:web
Test-bot: skip
2025-09-10 10:50:19 -05:00
Joshua Horton
47c1310f8d refactor(web): improve encapsulation for edit-distance calculation objects
Build-bot: skip build:web
Test-bot: skip
2025-09-10 10:16:37 -05:00
Joshua Horton
c56206c3f1 feat(web): support partial split + merge edits
After a bit of thought, I realized that it's feasible to support certain kinds of "partial" splits and edits.  If the only missing portion is entirely on one end or the other of the "combined" token, that isn't costly to compute - and it very much matches the specific cases that motivated 'merge' / 'split' support to begin with.

Suppose the word `can't` is partially in the context, at the start of the sliding context window.  Sliding backward one character at a time and using our default wordbreaker, we'd get...
- `t`
- `'`, `t`
- `n't`

`n't` is a "partial merge" scenario - we're missing the 'n', but the rest of the pieces are present.  The new changes allow us to detect that `'` and `t` combine as part of the `n't` token.

Note that this still requires a 1-to-many relationship between the "input" and "match" string sequences; there will be no support for a hypothetical "merge-then-split" operation.  (Say, combining 2 and splitting the result into 3 - or vice versa.)
2025-09-10 08:25:50 -05:00
Joshua Horton
5c6a95284a change(web): edit path edges should report alignment indices instead of texts
This change will provide a way to align more directly from edit path data, rather than rely on the post-op guesswork that's been used until now to approximate it.
2025-09-10 08:25:33 -05:00
Joshua Horton
0fbf9c028e feat(web): support split, merge for edit-path construction
Relates-to: #14679

The goal of this PR is to facilitate better handling for token splits and token merges.
2025-09-10 08:25:13 -05:00
Joshua Horton
01d73079a9 refactor(web): better edge-finder typing, cleanup 2025-09-10 08:24:37 -05:00
Joshua Horton
88393c515d refactor(web): refactor edit-path construction to support extensions from subclasses 2025-09-10 08:24:37 -05:00
Joshua Horton
36cee82da8 refactor(web): relocate getMergeSplitParent 2025-09-10 08:23:59 -05:00
Joshua Horton
8ca4b8b3cd feat(web): start support for calculating 'split', 'merge' edits 2025-09-10 08:23:59 -05:00
Joshua Horton
1853af628b refactor(web): refactor distance-calculation method that extends path on new input 2025-09-10 08:23:30 -05:00