Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { LegacyQuotientSpur } from "./legacy-quotient-spur.js";
import { LegacyQuotientRoot } from "./legacy-quotient-root.js";
import { generateSubsetId } from './tokenization-subsets.js';

import Distribution = LexicalModelTypes.Distribution;
import LexicalModel = LexicalModelTypes.LexicalModel;
import Transform = LexicalModelTypes.Transform;

Expand Down Expand Up @@ -119,14 +118,6 @@ export class ContextToken {
return new ContextToken(searchModule, isPartial);
}

/**
* Call this to record the original keystroke Transforms for the context range
* corresponding to this token.
*/
addInput(inputSource: PathInputProperties, distribution: Distribution<Transform>) {
this._searchModule = new LegacyQuotientSpur(this._searchModule, distribution, inputSource);
}

get inputCount() {
return this._searchModule.inputCount;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ import TransformUtils from '../transformUtils.js';
import { computeDistance, EditOperation, EditTuple } from './classical-calculation.js';
import { determineModelTokenizer } from '../model-helpers.js';
import { ExtendedEditOperation, SegmentableDistanceCalculation } from './segmentable-calculation.js';
import { LegacyQuotientRoot } from './legacy-quotient-root.js';
import { LegacyQuotientSpur } from './legacy-quotient-spur.js';
import { PathInputProperties } from './search-quotient-node.js';
import { TransitionEdge } from './tokenization-subsets.js';

import LexicalModel = LexicalModelTypes.LexicalModel;
import Transform = LexicalModelTypes.Transform;
import { LegacyQuotientRoot } from './legacy-quotient-root.js';

// May be able to "get away" with 2 & 5 or so, but having extra will likely help
// with edit path stability.
Expand Down Expand Up @@ -637,8 +638,10 @@ export class ContextTokenization {
inputSource.segment.end = appliedLength;
}

affectedToken = new ContextToken(affectedToken);
affectedToken.addInput(inputSource, distribution);
affectedToken = new ContextToken(
new LegacyQuotientSpur(affectedToken.searchModule, distribution, inputSource),
affectedToken.isPartial
);

const tokenize = determineModelTokenizer(lexicalModel);
affectedToken.isWhitespace = tokenize({left: affectedToken.exampleInput, startOfBuffer: false, endOfBuffer: false}).left[0]?.isWhitespace ?? false;
Expand Down
Loading
Loading