Dr Mark C. Sinclair
Dr Mark C. Sinclair
Are these getters ever used? - [`mapKey()`](https://github.com/keymanapp/keyman/blob/69d162696a2175b6805e68bae31bf9dddfc267ce/web/src/engine/predictive-text/worker-thread/src/main/correction/classical-calculation.ts#L775-L779) - [`lastInputEntry()`](https://github.com/keymanapp/keyman/blob/69d162696a2175b6805e68bae31bf9dddfc267ce/web/src/engine/predictive-text/worker-thread/src/main/correction/classical-calculation.ts#L781-L783) - [`lastMatchEntry()`](https://github.com/keymanapp/keyman/blob/69d162696a2175b6805e68bae31bf9dddfc267ce/web/src/engine/predictive-text/worker-thread/src/main/correction/classical-calculation.ts#L785-L787)
Looking at `context-token.ts`. It would be good to see some unit tests on [`sourceRangeKey()`](https://github.com/keymanapp/keyman/blob/69d162696a2175b6805e68bae31bf9dddfc267ce/web/src/engine/predictive-text/worker-thread/src/main/correction/context-token.ts#L167C7-L176)
A Javadoc comment on `toMathematicalSMP()` in `context-token.tests.ts` would be helpful, including SMP is Supplementary Multilingual Plane
@jahorton @mcdurdin Design choices (code structure, algorithms, etc) should be driven not only by execution speed and memory use (although these can be crucial considerations, especially in some circumstances), but...
Returning to look at `context-token.ts`. It would be good to have data field Javadoc comments on: - [`TokenInputSource.trueTransform`](https://github.com/keymanapp/keyman/blob/f1cafcb3af7d1d20b6e619f97574a7b406a59b1d/web/src/engine/predictive-text/worker-thread/src/main/correction/context-token.ts#L25) - [`TokenInputSource.inputStartIndex`](https://github.com/keymanapp/keyman/blob/f1cafcb3af7d1d20b6e619f97574a7b406a59b1d/web/src/engine/predictive-text/worker-thread/src/main/correction/context-token.ts#L26) - [`ContextToken.isPartial`](https://github.com/keymanapp/keyman/blob/f1cafcb3af7d1d20b6e619f97574a7b406a59b1d/web/src/engine/predictive-text/worker-thread/src/main/correction/context-token.ts#L62) - [`ContextToken.merge()`](https://github.com/keymanapp/keyman/blob/f1cafcb3af7d1d20b6e619f97574a7b406a59b1d/web/src/engine/predictive-text/worker-thread/src/main/correction/context-token.ts#L212-L273) (currently an incorrect `@param split` is...
Moving to `context-state.ts`. In `analyzeTransition()` ([ln196](https://github.com/keymanapp/keyman/blob/f1cafcb3af7d1d20b6e619f97574a7b406a59b1d/web/src/engine/predictive-text/worker-thread/src/main/correction/context-state.ts#L196-L197)), why can token substitution fail for large applied suggestions? How can `transformDistrution` be optional? ([here](https://github.com/keymanapp/keyman/blob/f1cafcb3af7d1d20b6e619f97574a7b406a59b1d/web/src/engine/predictive-text/worker-thread/src/main/correction/context-state.ts#L195-L201))
In `context-state.tests.ts`, I am not sure I understand this often repeated comment: ``` // // Phrased this way to facilitate TS type-inference; assert.isTrue() does // // NOT do this for...
In `context-state.tests.ts`, should [`determineContextSlideDeltas`](https://github.com/keymanapp/keyman/blob/f1cafcb3af7d1d20b6e619f97574a7b406a59b1d/web/src/test/auto/headless/engine/predictive-text/worker-thread/context/context-state.tests.ts#L475) be `determineContextSlideTransform`?
Turning to `context-tokenization.ts`. It would be good to have Javadoc comments on: - [`EditTokenMap`](https://github.com/keymanapp/keyman/blob/f1cafcb3af7d1d20b6e619f97574a7b406a59b1d/web/src/engine/predictive-text/worker-thread/src/main/correction/context-tokenization.ts#L28-L31) - [`TokenMergeMap`](https://github.com/keymanapp/keyman/blob/f1cafcb3af7d1d20b6e619f97574a7b406a59b1d/web/src/engine/predictive-text/worker-thread/src/main/correction/context-tokenization.ts#L33-L36) - [`TokenSplitMap`](https://github.com/keymanapp/keyman/blob/f1cafcb3af7d1d20b6e619f97574a7b406a59b1d/web/src/engine/predictive-text/worker-thread/src/main/correction/context-tokenization.ts#L38-L41) - `analyzePathMergesAndSplits()` [params](https://github.com/keymanapp/keyman/blob/f1cafcb3af7d1d20b6e619f97574a7b406a59b1d/web/src/engine/predictive-text/worker-thread/src/main/correction/context-tokenization.ts#L900-L901) - `determineTaillessTrueKeystroke()` [param](https://github.com/keymanapp/keyman/blob/f1cafcb3af7d1d20b6e619f97574a7b406a59b1d/web/src/engine/predictive-text/worker-thread/src/main/correction/context-tokenization.ts#L1110C3-L1110C31)
In `context-tokenization.tests.ts`, could some of the repeated helper/variables ([here](https://github.com/keymanapp/keyman/blob/f1cafcb3af7d1d20b6e619f97574a7b406a59b1d/web/src/test/auto/headless/engine/predictive-text/worker-thread/context/context-tokenization.tests.ts#L23-L24) and [here](https://github.com/keymanapp/keyman/blob/f1cafcb3af7d1d20b6e619f97574a7b406a59b1d/web/src/test/auto/headless/engine/predictive-text/worker-thread/context/context-tokenization.tests.ts#L44-L62)) be imported from `context-token.tests.ts` or plced in a shared helper file? Should [`testEdgeWindowSpec`](https://github.com/keymanapp/keyman/blob/f1cafcb3af7d1d20b6e619f97574a7b406a59b1d/web/src/test/auto/headless/engine/predictive-text/worker-thread/context/context-tokenization.tests.ts#L64-L67) not be initialised to the [constants](https://github.com/keymanapp/keyman/blob/f1cafcb3af7d1d20b6e619f97574a7b406a59b1d/web/src/engine/predictive-text/worker-thread/src/main/correction/context-tokenization.ts#L23-L26)...