change(web): add header comments, reorder imports

This commit is contained in:
Joshua Horton 2025-08-12 08:54:23 -05:00
parent a54f232154
commit e69c6cfecd
2 changed files with 23 additions and 6 deletions

View file

@ -1,3 +1,12 @@
/*
* Keyman is copyright (C) SIL Global. MIT License.
*
* Created by jahorton on 2025-07-30
*
* Represents cached data about one potential tokenization of contents of
* the sliding context window for one specific instance of context state.
*/
import { ContextToken } from './context-token.js';
import { TrackedContextStateAlignment } from './context-tracker.js';
@ -36,7 +45,7 @@ export class ContextTokenization {
*/
get exampleInput(): string[] {
return this.tokens
// Hide any tokens representing wordbreaks. (Thinking ahead to phrase-level possibilities)
// Hide any tokens representing invisible wordbreaks. (Thinking ahead to phrase-level possibilities)
.filter(token => token.exampleInput !== null)
.map(token => token.exampleInput);
}

View file

@ -1,13 +1,21 @@
/*
* Keyman is copyright (C) SIL Global. MIT License.
*
* Created by jahorton on 2025-07-30
*
* This file contains low-level tests designed to validate the behavior of the
* of the ContextTokenization class and its integration with the lower-level
* classes that it utilizes.
*/
import { assert } from 'chai';
import { ContextToken } from '#./correction/context-token.js';
import { ContextTokenization } from '#./correction/context-tokenization.js';
import * as models from '#./models/index.js';
import { default as defaultBreaker } from '@keymanapp/models-wordbreakers';
import { jsonFixture } from '@keymanapp/common-test-resources/model-helpers.mjs';
var TrieModel = models.TrieModel;
import { ContextToken } from '#./correction/context-token.js';
import { ContextTokenization } from '#./correction/context-tokenization.js';
import { TrieModel } from '#./models/index.js';
var plainModel = new TrieModel(jsonFixture('models/tries/english-1000'),
{wordBreaker: defaultBreaker});