@storyteller-platform/align 0.1.15 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/binding.gyp +26 -0
  2. package/package.json +4 -2
  3. package/prebuilds/darwin-arm64/@storyteller-platform+align.node +0 -0
  4. package/prebuilds/linux-arm64/@storyteller-platform+align.node +0 -0
  5. package/prebuilds/linux-x64/@storyteller-platform+align.node +0 -0
  6. package/dist/align/__tests__/align.test.cjs +0 -283
  7. package/dist/align/__tests__/align.test.d.cts +0 -2
  8. package/dist/align/__tests__/align.test.d.ts +0 -2
  9. package/dist/align/__tests__/align.test.js +0 -219
  10. package/dist/align/__tests__/slugify.test.cjs +0 -64
  11. package/dist/align/__tests__/slugify.test.d.cts +0 -2
  12. package/dist/align/__tests__/slugify.test.d.ts +0 -2
  13. package/dist/align/__tests__/slugify.test.js +0 -41
  14. package/dist/errorAlign/__tests__/errorAlign.test.cjs +0 -100
  15. package/dist/errorAlign/__tests__/errorAlign.test.d.cts +0 -2
  16. package/dist/errorAlign/__tests__/errorAlign.test.d.ts +0 -2
  17. package/dist/errorAlign/__tests__/errorAlign.test.js +0 -77
  18. package/dist/errorAlign/__tests__/native.test.cjs +0 -118
  19. package/dist/errorAlign/__tests__/native.test.d.cts +0 -2
  20. package/dist/errorAlign/__tests__/native.test.d.ts +0 -2
  21. package/dist/errorAlign/__tests__/native.test.js +0 -107
  22. package/dist/markup/__tests__/markup.test.cjs +0 -491
  23. package/dist/markup/__tests__/markup.test.d.cts +0 -2
  24. package/dist/markup/__tests__/markup.test.d.ts +0 -2
  25. package/dist/markup/__tests__/markup.test.js +0 -468
  26. package/dist/markup/__tests__/parseDom.test.cjs +0 -112
  27. package/dist/markup/__tests__/parseDom.test.d.cts +0 -2
  28. package/dist/markup/__tests__/parseDom.test.d.ts +0 -2
  29. package/dist/markup/__tests__/parseDom.test.js +0 -89
  30. package/dist/markup/__tests__/serializeDom.test.cjs +0 -120
  31. package/dist/markup/__tests__/serializeDom.test.d.cts +0 -2
  32. package/dist/markup/__tests__/serializeDom.test.d.ts +0 -2
  33. package/dist/markup/__tests__/serializeDom.test.js +0 -97
  34. package/dist/markup/__tests__/transform.test.cjs +0 -122
  35. package/dist/markup/__tests__/transform.test.d.cts +0 -2
  36. package/dist/markup/__tests__/transform.test.d.ts +0 -2
  37. package/dist/markup/__tests__/transform.test.js +0 -99
  38. package/dist/process/__tests__/processAudiobook.test.cjs +0 -232
  39. package/dist/process/__tests__/processAudiobook.test.d.cts +0 -2
  40. package/dist/process/__tests__/processAudiobook.test.d.ts +0 -2
  41. package/dist/process/__tests__/processAudiobook.test.js +0 -209
@@ -1,100 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (let key of __getOwnPropNames(from))
11
- if (!__hasOwnProp.call(to, key) && key !== except)
12
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- }
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
- var import_node_assert = __toESM(require("node:assert"), 1);
25
- var import_node_test = require("node:test");
26
- var import_editDistance = require("../editDistance.cjs");
27
- var import_errorAlign = require("../errorAlign.cjs");
28
- var import_utils = require("../utils.cjs");
29
- void (0, import_node_test.describe)("errorAlign", () => {
30
- void (0, import_node_test.test)("error alignment for an example including all substitution types", () => {
31
- const ref = "This is a substitution test deleted.";
32
- const hyp = "Inserted this is a contribution test.";
33
- const alignments = (0, import_errorAlign.errorAlign)(ref, hyp);
34
- import_node_assert.default.deepStrictEqual(
35
- alignments.map((a) => a.opType),
36
- ["INSERT", "MATCH", "MATCH", "MATCH", "SUBSTITUTE", "MATCH", "DELETE"]
37
- );
38
- });
39
- void (0, import_node_test.test)("error alignment for full match", () => {
40
- const ref = "This is a test.";
41
- const hyp = "This is a test.";
42
- const alignments = (0, import_errorAlign.errorAlign)(ref, hyp);
43
- import_node_assert.default.deepStrictEqual(
44
- alignments.map((a) => a.opType),
45
- ["MATCH", "MATCH", "MATCH", "MATCH"]
46
- );
47
- });
48
- void (0, import_node_test.test)("error alignment for partial substitutions and insertions with compound markers", () => {
49
- var _a, _b;
50
- const ref = "test";
51
- const hyp = "testpartial";
52
- const alignments = (0, import_errorAlign.errorAlign)(ref, hyp);
53
- import_node_assert.default.strictEqual(alignments.length, 2);
54
- import_node_assert.default.strictEqual((_a = alignments[0]) == null ? void 0 : _a.opType, "SUBSTITUTE");
55
- import_node_assert.default.strictEqual(alignments[0].leftCompound, false);
56
- import_node_assert.default.strictEqual(alignments[0].rightCompound, true);
57
- import_node_assert.default.strictEqual((_b = alignments[1]) == null ? void 0 : _b.opType, "INSERT");
58
- import_node_assert.default.strictEqual(alignments[1].leftCompound, true);
59
- import_node_assert.default.strictEqual(alignments[1].rightCompound, false);
60
- });
61
- });
62
- void (0, import_node_test.test)("character categorization", () => {
63
- import_node_assert.default.strictEqual((0, import_utils.categorizeChar)("<"), 0);
64
- import_node_assert.default.strictEqual((0, import_utils.categorizeChar)("b"), 1);
65
- import_node_assert.default.strictEqual((0, import_utils.categorizeChar)("a"), 2);
66
- import_node_assert.default.strictEqual((0, import_utils.categorizeChar)("'"), 3);
67
- });
68
- void (0, import_node_test.test)("string representation of alignment objects", () => {
69
- const deleteAlignment = (0, import_errorAlign.errorAlign)("deleted", "")[0];
70
- import_node_assert.default.strictEqual(
71
- deleteAlignment == null ? void 0 : deleteAlignment.toString(),
72
- 'Alignment(DELETE: "deleted")'
73
- );
74
- const insertAlignment = (0, import_errorAlign.errorAlign)("", "inserted")[0];
75
- import_node_assert.default.strictEqual(
76
- insertAlignment == null ? void 0 : insertAlignment.toString(),
77
- 'Alignment(INSERT: "inserted")'
78
- );
79
- const substituteAlignment = (0, import_errorAlign.errorAlign)(
80
- "substitution",
81
- "substitutiontesting"
82
- )[0];
83
- import_node_assert.default.strictEqual(substituteAlignment == null ? void 0 : substituteAlignment.leftCompound, false);
84
- import_node_assert.default.strictEqual(substituteAlignment.rightCompound, true);
85
- import_node_assert.default.strictEqual(
86
- substituteAlignment.toString(),
87
- 'Alignment(SUBSTITUTE: "substitution"- -> "substitution")'
88
- );
89
- const matchAlignment = (0, import_errorAlign.errorAlign)("test", "test")[0];
90
- import_node_assert.default.strictEqual(
91
- matchAlignment == null ? void 0 : matchAlignment.toString(),
92
- 'Alignment(MATCH: "test" == "test")'
93
- );
94
- });
95
- void (0, import_node_test.test)("Levenshtein distance matrix computation", () => {
96
- const ref = "kitten";
97
- const hyp = "sitting";
98
- const distanceMatrix = (0, import_editDistance.computeLevenshteinDistanceMatrix)(ref, hyp);
99
- import_node_assert.default.strictEqual(distanceMatrix.at(-1).at(-1), 3);
100
- });
@@ -1,2 +0,0 @@
1
-
2
- export { }
@@ -1,2 +0,0 @@
1
-
2
- export { }
@@ -1,77 +0,0 @@
1
- import assert from "node:assert";
2
- import { describe, test } from "node:test";
3
- import { computeLevenshteinDistanceMatrix } from "../editDistance.js";
4
- import { errorAlign } from "../errorAlign.js";
5
- import { categorizeChar } from "../utils.js";
6
- void describe("errorAlign", () => {
7
- void test("error alignment for an example including all substitution types", () => {
8
- const ref = "This is a substitution test deleted.";
9
- const hyp = "Inserted this is a contribution test.";
10
- const alignments = errorAlign(ref, hyp);
11
- assert.deepStrictEqual(
12
- alignments.map((a) => a.opType),
13
- ["INSERT", "MATCH", "MATCH", "MATCH", "SUBSTITUTE", "MATCH", "DELETE"]
14
- );
15
- });
16
- void test("error alignment for full match", () => {
17
- const ref = "This is a test.";
18
- const hyp = "This is a test.";
19
- const alignments = errorAlign(ref, hyp);
20
- assert.deepStrictEqual(
21
- alignments.map((a) => a.opType),
22
- ["MATCH", "MATCH", "MATCH", "MATCH"]
23
- );
24
- });
25
- void test("error alignment for partial substitutions and insertions with compound markers", () => {
26
- var _a, _b;
27
- const ref = "test";
28
- const hyp = "testpartial";
29
- const alignments = errorAlign(ref, hyp);
30
- assert.strictEqual(alignments.length, 2);
31
- assert.strictEqual((_a = alignments[0]) == null ? void 0 : _a.opType, "SUBSTITUTE");
32
- assert.strictEqual(alignments[0].leftCompound, false);
33
- assert.strictEqual(alignments[0].rightCompound, true);
34
- assert.strictEqual((_b = alignments[1]) == null ? void 0 : _b.opType, "INSERT");
35
- assert.strictEqual(alignments[1].leftCompound, true);
36
- assert.strictEqual(alignments[1].rightCompound, false);
37
- });
38
- });
39
- void test("character categorization", () => {
40
- assert.strictEqual(categorizeChar("<"), 0);
41
- assert.strictEqual(categorizeChar("b"), 1);
42
- assert.strictEqual(categorizeChar("a"), 2);
43
- assert.strictEqual(categorizeChar("'"), 3);
44
- });
45
- void test("string representation of alignment objects", () => {
46
- const deleteAlignment = errorAlign("deleted", "")[0];
47
- assert.strictEqual(
48
- deleteAlignment == null ? void 0 : deleteAlignment.toString(),
49
- 'Alignment(DELETE: "deleted")'
50
- );
51
- const insertAlignment = errorAlign("", "inserted")[0];
52
- assert.strictEqual(
53
- insertAlignment == null ? void 0 : insertAlignment.toString(),
54
- 'Alignment(INSERT: "inserted")'
55
- );
56
- const substituteAlignment = errorAlign(
57
- "substitution",
58
- "substitutiontesting"
59
- )[0];
60
- assert.strictEqual(substituteAlignment == null ? void 0 : substituteAlignment.leftCompound, false);
61
- assert.strictEqual(substituteAlignment.rightCompound, true);
62
- assert.strictEqual(
63
- substituteAlignment.toString(),
64
- 'Alignment(SUBSTITUTE: "substitution"- -> "substitution")'
65
- );
66
- const matchAlignment = errorAlign("test", "test")[0];
67
- assert.strictEqual(
68
- matchAlignment == null ? void 0 : matchAlignment.toString(),
69
- 'Alignment(MATCH: "test" == "test")'
70
- );
71
- });
72
- void test("Levenshtein distance matrix computation", () => {
73
- const ref = "kitten";
74
- const hyp = "sitting";
75
- const distanceMatrix = computeLevenshteinDistanceMatrix(ref, hyp);
76
- assert.strictEqual(distanceMatrix.at(-1).at(-1), 3);
77
- });
@@ -1,118 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (let key of __getOwnPropNames(from))
11
- if (!__hasOwnProp.call(to, key) && key !== except)
12
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- }
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
- var import_node_assert = __toESM(require("node:assert"), 1);
25
- var import_node_test = require("node:test");
26
- var import_beamSearch = require("../beamSearch.cjs");
27
- var import_editDistance = require("../editDistance.cjs");
28
- var import_graphMetadata = require("../graphMetadata.cjs");
29
- var import_native = require("../native.cjs");
30
- var import_pathToAlignment = require("../pathToAlignment.cjs");
31
- var import_utils = require("../utils.cjs");
32
- void (0, import_node_test.describe)("native C++ vs TypeScript implementations", () => {
33
- void (0, import_node_test.describe)("Levenshtein distance matrix", () => {
34
- void (0, import_node_test.test)("string input", () => {
35
- const ref = "kitten";
36
- const hyp = "sitting";
37
- const tsResult = (0, import_editDistance.computeLevenshteinDistanceMatrix)(ref, hyp);
38
- const nativeResult = (0, import_native.computeLevenshteinDistanceMatrix)(ref, hyp);
39
- import_node_assert.default.deepStrictEqual(nativeResult, tsResult);
40
- });
41
- void (0, import_node_test.test)("string array input", () => {
42
- const ref = ["hello", "world"];
43
- const hyp = ["hello", "there"];
44
- const tsResult = (0, import_editDistance.computeLevenshteinDistanceMatrix)(ref, hyp);
45
- const nativeResult = (0, import_native.computeLevenshteinDistanceMatrix)(ref, hyp);
46
- import_node_assert.default.deepStrictEqual(nativeResult, tsResult);
47
- });
48
- void (0, import_node_test.test)("with backtrace", () => {
49
- const ref = "kitten";
50
- const hyp = "sitting";
51
- const tsResult = (0, import_editDistance.computeLevenshteinDistanceMatrix)(ref, hyp, true);
52
- const nativeResult = (0, import_native.computeLevenshteinDistanceMatrix)(ref, hyp, true);
53
- import_node_assert.default.deepStrictEqual(nativeResult, tsResult);
54
- });
55
- });
56
- void (0, import_node_test.describe)("error align distance matrix", () => {
57
- void (0, import_node_test.test)("string input", () => {
58
- const ref = "test";
59
- const hyp = "best";
60
- const tsResult = (0, import_editDistance.computeErrorAlignDistanceMatrix)(ref, hyp);
61
- const nativeResult = (0, import_native.computeErrorAlignDistanceMatrix)(ref, hyp);
62
- import_node_assert.default.deepStrictEqual(nativeResult, tsResult);
63
- });
64
- void (0, import_node_test.test)("with backtrace", () => {
65
- const ref = "test";
66
- const hyp = "best";
67
- const tsResult = (0, import_editDistance.computeErrorAlignDistanceMatrix)(ref, hyp, true);
68
- const nativeResult = (0, import_native.computeErrorAlignDistanceMatrix)(ref, hyp, true);
69
- import_node_assert.default.deepStrictEqual(nativeResult, tsResult);
70
- });
71
- });
72
- void (0, import_node_test.describe)("beam search", () => {
73
- function buildSubgraphMetadata(ref, hyp) {
74
- const tokenizer = import_utils.basicTokenizer;
75
- const normalizer = import_utils.basicNormalizer;
76
- const unpackedTokenizer = (0, import_utils.unpackRegexMatch)(tokenizer);
77
- const ensuredNormalizer = (0, import_utils.ensureLengthPreservation)(normalizer);
78
- const refTokenMatches = unpackedTokenizer(ref);
79
- const hypTokenMatches = unpackedTokenizer(hyp);
80
- const refNorm = refTokenMatches.map(([r]) => ensuredNormalizer(r));
81
- const hypNorm = hypTokenMatches.map(([h]) => ensuredNormalizer(h));
82
- return new import_graphMetadata.SubgraphMetadata(
83
- ref,
84
- hyp,
85
- refTokenMatches,
86
- hypTokenMatches,
87
- refNorm,
88
- hypNorm
89
- );
90
- }
91
- void (0, import_node_test.test)("simple substitution", () => {
92
- const src = buildSubgraphMetadata("hello", "jello");
93
- const tsPath = (0, import_beamSearch.errorAlignBeamSearch)(src);
94
- const nativePath = (0, import_native.errorAlignBeamSearch)(src);
95
- const tsAlignments = (0, import_pathToAlignment.getAlignments)(tsPath);
96
- const nativeAlignments = (0, import_pathToAlignment.getAlignments)(nativePath);
97
- import_node_assert.default.deepStrictEqual(nativeAlignments, tsAlignments);
98
- });
99
- void (0, import_node_test.test)("multi-word alignment with all op types", () => {
100
- const ref = "This is a substitution test deleted.";
101
- const hyp = "Inserted this is a contribution test.";
102
- const src = buildSubgraphMetadata(ref, hyp);
103
- const tsPath = (0, import_beamSearch.errorAlignBeamSearch)(src);
104
- const nativePath = (0, import_native.errorAlignBeamSearch)(src);
105
- const tsAlignments = (0, import_pathToAlignment.getAlignments)(tsPath);
106
- const nativeAlignments = (0, import_pathToAlignment.getAlignments)(nativePath);
107
- import_node_assert.default.deepStrictEqual(nativeAlignments, tsAlignments);
108
- });
109
- void (0, import_node_test.test)("identical strings", () => {
110
- const src = buildSubgraphMetadata("test words", "test words");
111
- const tsPath = (0, import_beamSearch.errorAlignBeamSearch)(src);
112
- const nativePath = (0, import_native.errorAlignBeamSearch)(src);
113
- const tsAlignments = (0, import_pathToAlignment.getAlignments)(tsPath);
114
- const nativeAlignments = (0, import_pathToAlignment.getAlignments)(nativePath);
115
- import_node_assert.default.deepStrictEqual(nativeAlignments, tsAlignments);
116
- });
117
- });
118
- });
@@ -1,2 +0,0 @@
1
-
2
- export { }
@@ -1,2 +0,0 @@
1
-
2
- export { }
@@ -1,107 +0,0 @@
1
- import assert from "node:assert";
2
- import { describe, test } from "node:test";
3
- import { errorAlignBeamSearch as tsBeamSearch } from "../beamSearch.js";
4
- import {
5
- computeErrorAlignDistanceMatrix as tsErrorAlign,
6
- computeLevenshteinDistanceMatrix as tsLevenshtein
7
- } from "../editDistance.js";
8
- import { SubgraphMetadata } from "../graphMetadata.js";
9
- import {
10
- computeErrorAlignDistanceMatrix as nativeErrorAlign,
11
- computeLevenshteinDistanceMatrix as nativeLevenshtein,
12
- errorAlignBeamSearch as nativeBeamSearch
13
- } from "../native.js";
14
- import { getAlignments } from "../pathToAlignment.js";
15
- import {
16
- basicNormalizer,
17
- basicTokenizer,
18
- ensureLengthPreservation,
19
- unpackRegexMatch
20
- } from "../utils.js";
21
- void describe("native C++ vs TypeScript implementations", () => {
22
- void describe("Levenshtein distance matrix", () => {
23
- void test("string input", () => {
24
- const ref = "kitten";
25
- const hyp = "sitting";
26
- const tsResult = tsLevenshtein(ref, hyp);
27
- const nativeResult = nativeLevenshtein(ref, hyp);
28
- assert.deepStrictEqual(nativeResult, tsResult);
29
- });
30
- void test("string array input", () => {
31
- const ref = ["hello", "world"];
32
- const hyp = ["hello", "there"];
33
- const tsResult = tsLevenshtein(ref, hyp);
34
- const nativeResult = nativeLevenshtein(ref, hyp);
35
- assert.deepStrictEqual(nativeResult, tsResult);
36
- });
37
- void test("with backtrace", () => {
38
- const ref = "kitten";
39
- const hyp = "sitting";
40
- const tsResult = tsLevenshtein(ref, hyp, true);
41
- const nativeResult = nativeLevenshtein(ref, hyp, true);
42
- assert.deepStrictEqual(nativeResult, tsResult);
43
- });
44
- });
45
- void describe("error align distance matrix", () => {
46
- void test("string input", () => {
47
- const ref = "test";
48
- const hyp = "best";
49
- const tsResult = tsErrorAlign(ref, hyp);
50
- const nativeResult = nativeErrorAlign(ref, hyp);
51
- assert.deepStrictEqual(nativeResult, tsResult);
52
- });
53
- void test("with backtrace", () => {
54
- const ref = "test";
55
- const hyp = "best";
56
- const tsResult = tsErrorAlign(ref, hyp, true);
57
- const nativeResult = nativeErrorAlign(ref, hyp, true);
58
- assert.deepStrictEqual(nativeResult, tsResult);
59
- });
60
- });
61
- void describe("beam search", () => {
62
- function buildSubgraphMetadata(ref, hyp) {
63
- const tokenizer = basicTokenizer;
64
- const normalizer = basicNormalizer;
65
- const unpackedTokenizer = unpackRegexMatch(tokenizer);
66
- const ensuredNormalizer = ensureLengthPreservation(normalizer);
67
- const refTokenMatches = unpackedTokenizer(ref);
68
- const hypTokenMatches = unpackedTokenizer(hyp);
69
- const refNorm = refTokenMatches.map(([r]) => ensuredNormalizer(r));
70
- const hypNorm = hypTokenMatches.map(([h]) => ensuredNormalizer(h));
71
- return new SubgraphMetadata(
72
- ref,
73
- hyp,
74
- refTokenMatches,
75
- hypTokenMatches,
76
- refNorm,
77
- hypNorm
78
- );
79
- }
80
- void test("simple substitution", () => {
81
- const src = buildSubgraphMetadata("hello", "jello");
82
- const tsPath = tsBeamSearch(src);
83
- const nativePath = nativeBeamSearch(src);
84
- const tsAlignments = getAlignments(tsPath);
85
- const nativeAlignments = getAlignments(nativePath);
86
- assert.deepStrictEqual(nativeAlignments, tsAlignments);
87
- });
88
- void test("multi-word alignment with all op types", () => {
89
- const ref = "This is a substitution test deleted.";
90
- const hyp = "Inserted this is a contribution test.";
91
- const src = buildSubgraphMetadata(ref, hyp);
92
- const tsPath = tsBeamSearch(src);
93
- const nativePath = nativeBeamSearch(src);
94
- const tsAlignments = getAlignments(tsPath);
95
- const nativeAlignments = getAlignments(nativePath);
96
- assert.deepStrictEqual(nativeAlignments, tsAlignments);
97
- });
98
- void test("identical strings", () => {
99
- const src = buildSubgraphMetadata("test words", "test words");
100
- const tsPath = tsBeamSearch(src);
101
- const nativePath = nativeBeamSearch(src);
102
- const tsAlignments = getAlignments(tsPath);
103
- const nativeAlignments = getAlignments(nativePath);
104
- assert.deepStrictEqual(nativeAlignments, tsAlignments);
105
- });
106
- });
107
- });