Skip to content
Open
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
2 changes: 2 additions & 0 deletions web/src/engine/predictive-text/worker-thread/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ SRCMAP_CLEANER="${KEYMAN_ROOT}/web/build/tools/building/sourcemap-root/index.js"
################################ Main script ################################

SUBPROJECT_NAME=engine/predictive-text/worker-thread
SUBPROJECT_HELPERS=engine/predictive-text/helpers

builder_describe \
"Compiles the Language Modeling Layer for common use in predictive text and autocorrective applications." \
Expand Down Expand Up @@ -103,6 +104,7 @@ function do_test() {
WTR_INSPECT=" --manual"
fi

test-headless-typescript $SUBPROJECT_HELPERS
test-headless-typescript $SUBPROJECT_NAME

web-test-runner --config ./src/tests/test-runner/web-test-runner${WTR_CONFIG}.config.mjs ${WTR_INSPECT}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@

import { assert } from "chai";

import { SearchQuotientNode } from "@keymanapp/lm-worker/test-index";
import { SearchQuotientNode, SearchQuotientSpur } from "@keymanapp/lm-worker/test-index";

import { constituentPaths } from "./constituentPaths.js";
import { quotientPathHasInputs } from "./quotientPathHasInputs.js";
import { buildAlphabeticClusterFixtures } from "./buildAlphabeticClusteredFixture.js";

describe('buildAlphabeticClusteredFixture() fixture', () => {
Expand All @@ -24,7 +23,10 @@ describe('buildAlphabeticClusteredFixture() fixture', () => {
const allDists = Object.values(distributions).map(set => Object.values(set)).flat();
const finalClusterPaths = constituentPaths(clusters.cluster_k5c6) as SearchQuotientNode[][];

allPaths.forEach((spur) => assert.isOk(finalClusterPaths.find(seq => seq.indexOf(spur) > -1)));
allDists.forEach((dist) => assert.isOk(allPaths.find(path => quotientPathHasInputs(path, [dist]))));
allPaths
// This one path doesn't get clustered; it's the only way to reach excess length in this fixture.
.filter((spur) => spur != paths[4].path_k4c6)
.forEach((spur) => assert.isOk(finalClusterPaths.find(seq => seq.indexOf(spur) > -1), `spur ${spur.spaceId} is disconnected`));
allDists.forEach((dist) => assert.isOk(allPaths.find(path => (path as SearchQuotientSpur).inputs == dist), `distribution ${JSON.stringify(dist)} has no matching path`));
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,8 @@ export const buildAlphabeticClusterFixtures = () => {
distrib_c3_i2d0
}
},
root: rootPath,
paths: {
0: {
rootPath
},
1: {
path_k1c1_i1d0,
path_k1c2_i2d0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('constituentPaths', () => {
return type == 'insert' && typeSeq[index+1] == 'delete';
});
});
assert.isNotOk(shouldOccur);
assert.isOk(shouldOccur);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ describe('SearchQuotientCluster', () => {

const mergeResult = baseCluster.merge(new LegacyQuotientSpur(
// Is (and mocks) the head result from `path_k4c4_i1.split(3)`.
fixture.paths[0].rootPath,
fixture.root,
// Mocks the tail result from `path_k4c4_i1.split(3)`.
fixture.distributions[4].distrib_c2_i1d0, {
segment: {
Expand Down
Loading