@kensio/pinyinjs 1.7.7 → 1.7.8
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.
- package/README.md +2 -2
- package/data/full.counts +0 -0
- package/data/manifest.json +7 -0
- package/dist/dictionary/artifact-claims.d.ts +8 -0
- package/dist/dictionary/artifact-claims.d.ts.map +1 -1
- package/dist/dictionary/artifact-claims.js +11 -1
- package/dist/dictionary/artifact-claims.js.map +1 -1
- package/dist/dictionary/artifact.d.ts.map +1 -1
- package/dist/dictionary/artifact.js +3 -5
- package/dist/dictionary/artifact.js.map +1 -1
- package/dist/dictionary/source.d.ts +22 -0
- package/dist/dictionary/source.d.ts.map +1 -1
- package/dist/dictionary/source.js +24 -0
- package/dist/dictionary/source.js.map +1 -1
- package/dist/dictionary/word-counts.d.ts +74 -0
- package/dist/dictionary/word-counts.d.ts.map +1 -0
- package/dist/dictionary/word-counts.js +142 -0
- package/dist/dictionary/word-counts.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,8 +14,8 @@ pnpm add @kensio/pinyinjs
|
|
|
14
14
|
Node 22+, or any browser. The core imports no Node built-ins, and the package is
|
|
15
15
|
ESM only.
|
|
16
16
|
|
|
17
|
-
The dictionaries ship inside the package, and that is what makes it a 4 MB
|
|
18
|
-
download. `data/` is
|
|
17
|
+
The dictionaries ship inside the package, and that is what makes it a 4.7 MB
|
|
18
|
+
download. `data/` is 11 MB of artifacts and the point of the whole thing.
|
|
19
19
|
|
|
20
20
|
## Command line
|
|
21
21
|
|
package/data/full.counts
ADDED
|
Binary file
|
package/data/manifest.json
CHANGED
|
@@ -22,4 +22,12 @@ import type { DictionaryEntry } from "./entry.js";
|
|
|
22
22
|
* character reading a missing key falls back to.
|
|
23
23
|
*/
|
|
24
24
|
export declare function claimKeys(entries: readonly DictionaryEntry[]): ReadonlyMap<string, DictionaryEntry>;
|
|
25
|
+
/**
|
|
26
|
+
* The claimed keys in the order the artifact writes them.
|
|
27
|
+
*
|
|
28
|
+
* Sorted once, so that each of the files built from these keys is written from
|
|
29
|
+
* the entry it belongs to rather than from a second search for it, and so that
|
|
30
|
+
* they agree about which position holds which word.
|
|
31
|
+
*/
|
|
32
|
+
export declare function orderedClaims(claimed: ReadonlyMap<string, DictionaryEntry>): readonly (readonly [string, DictionaryEntry])[];
|
|
25
33
|
//# sourceMappingURL=artifact-claims.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-claims.d.ts","sourceRoot":"","sources":["../../src/dictionary/artifact-claims.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAuBlD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CACvB,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAiBtC"}
|
|
1
|
+
{"version":3,"file":"artifact-claims.d.ts","sourceRoot":"","sources":["../../src/dictionary/artifact-claims.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAuBlD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CACvB,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAiBtC;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,GAC5C,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,EAAE,CAEjD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { traditionalForms } from "./artifact-format.js";
|
|
1
|
+
import { byCodeUnit, traditionalForms } from "./artifact-format.js";
|
|
2
2
|
/**
|
|
3
3
|
* Let one entry claim each of its 繁體 spellings, where nothing outranks it.
|
|
4
4
|
*
|
|
@@ -44,4 +44,14 @@ export function claimKeys(entries) {
|
|
|
44
44
|
}
|
|
45
45
|
return claimed;
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* The claimed keys in the order the artifact writes them.
|
|
49
|
+
*
|
|
50
|
+
* Sorted once, so that each of the files built from these keys is written from
|
|
51
|
+
* the entry it belongs to rather than from a second search for it, and so that
|
|
52
|
+
* they agree about which position holds which word.
|
|
53
|
+
*/
|
|
54
|
+
export function orderedClaims(claimed) {
|
|
55
|
+
return [...claimed].toSorted(([left], [right]) => byCodeUnit(left, right));
|
|
56
|
+
}
|
|
47
57
|
//# sourceMappingURL=artifact-claims.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-claims.js","sourceRoot":"","sources":["../../src/dictionary/artifact-claims.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"artifact-claims.js","sourceRoot":"","sources":["../../src/dictionary/artifact-claims.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEpE;;;;;;GAMG;AACH,SAAS,gBAAgB,CACvB,OAAqC,EACrC,KAAsB;IAEtB,KAAK,MAAM,IAAI,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3C,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/B,MAAM,OAAO,GAAG,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;QAC3D,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,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AIlD,OAAO,
|
|
1
|
+
{"version":3,"file":"artifact.d.ts","sourceRoot":"","sources":["../../src/dictionary/artifact.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAIlD,OAAO,EAIL,KAAK,kBAAkB,EAIxB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,aAAa,EACb,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAwD9B;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,kBAAkB,CAiCpB"}
|
|
@@ -10,8 +10,8 @@ export { claimKeys } from "./artifact-claims.js";
|
|
|
10
10
|
export { findRoundTripFailure, readArtifact, readingsByKey, } from "./artifact-read.js";
|
|
11
11
|
import { FrequencyTable } from "./frequency-table.js";
|
|
12
12
|
import { KeyIndex } from "./key-index.js";
|
|
13
|
-
import { claimKeys } from "./artifact-claims.js";
|
|
14
|
-
import { ALTERNATE, BOUNDARY_SEPARATOR,
|
|
13
|
+
import { claimKeys, orderedClaims } from "./artifact-claims.js";
|
|
14
|
+
import { ALTERNATE, BOUNDARY_SEPARATOR, COLUMN, encodeReading, LINE, PROPER_NOUN_FLAG, } from "./artifact-format.js";
|
|
15
15
|
export { decodeReading, encodeReading, traditionalForms, } from "./artifact-format.js";
|
|
16
16
|
/**
|
|
17
17
|
* The default reading of each single character, as the artifact records it.
|
|
@@ -74,9 +74,7 @@ function trimColumns(columns) {
|
|
|
74
74
|
export function buildArtifact(entries) {
|
|
75
75
|
const claimed = claimKeys(entries);
|
|
76
76
|
const defaults = characterDefaults(claimed);
|
|
77
|
-
|
|
78
|
-
// from the entry it belongs to rather than from a second search for it.
|
|
79
|
-
const ordered = [...claimed].toSorted(([left], [right]) => byCodeUnit(left, right));
|
|
77
|
+
const ordered = orderedClaims(claimed);
|
|
80
78
|
const index = KeyIndex.from(ordered.map(([key]) => key).join(LINE));
|
|
81
79
|
const lines = [];
|
|
82
80
|
const frequencies = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact.js","sourceRoot":"","sources":["../../src/dictionary/artifact.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,aAAa,GACd,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"artifact.js","sourceRoot":"","sources":["../../src/dictionary/artifact.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,aAAa,GACd,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,MAAM,EAEN,aAAa,EACb,IAAI,EACJ,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,aAAa,EAEb,aAAa,EACb,g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AAC,UAAU,IAAI,EAAE,CAAC;iBACrB,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;iBAC5C,IAAI,CAAC,SAAS,CAAC;SACnB,CAAC,CACH,CAAC;QACF,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IAED,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE;QACvB,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QACzB,WAAW,EAAE,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,SAAS,EAAE;KAC3D,CAAC;AACJ,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { type ScriptTables } from "../script/conversion.js";
|
|
|
2
2
|
import type { DictionaryArtifact } from "./artifact.js";
|
|
3
3
|
import { Dictionary } from "./dictionary.js";
|
|
4
4
|
import type { Tier } from "./tiers.js";
|
|
5
|
+
import { WordCounts } from "./word-counts.js";
|
|
5
6
|
/**
|
|
6
7
|
* Where a dictionary's files are read from.
|
|
7
8
|
*
|
|
@@ -43,6 +44,27 @@ export declare function loadArtifact(source: DictionarySource, tier: Tier): Prom
|
|
|
43
44
|
* Load a tier and wrap it in a {@link Dictionary}.
|
|
44
45
|
*/
|
|
45
46
|
export declare function loadDictionary(source: DictionarySource, tier: Tier): Promise<Dictionary>;
|
|
47
|
+
/**
|
|
48
|
+
* The file the raw corpus counts live in.
|
|
49
|
+
*
|
|
50
|
+
* `full` alone, and outside the tiers rather than one per tier: a caller
|
|
51
|
+
* ranking words wants the whole vocabulary ordered, and a ranking over part of
|
|
52
|
+
* it answers a different question.
|
|
53
|
+
*/
|
|
54
|
+
export declare const COUNTS_FILE = "full.counts";
|
|
55
|
+
/**
|
|
56
|
+
* Load the raw corpus counts for the `full` tier.
|
|
57
|
+
*
|
|
58
|
+
* Separate from the dictionary for the same reason {@link loadScriptTables} is.
|
|
59
|
+
* Nothing on the decoding path reads counts, and the quantised frequencies the
|
|
60
|
+
* decoder does read already ship inside every tier. This file is 243 KB brotli
|
|
61
|
+
* against `full.freq`'s 148 KB, and only a caller that asks for it pays.
|
|
62
|
+
*
|
|
63
|
+
* The counts are positional over the `full` tier's keys, so pair them with a
|
|
64
|
+
* `full` {@link Dictionary} and nothing else. {@link WordCounts.size} and
|
|
65
|
+
* {@link Dictionary.size} agree where the two match.
|
|
66
|
+
*/
|
|
67
|
+
export declare function loadWordCounts(source: DictionarySource): Promise<WordCounts>;
|
|
46
68
|
/**
|
|
47
69
|
* The file the script conversion tables live in.
|
|
48
70
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/dictionary/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/dictionary/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACjD,2CAA2C;IAC3C,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CACvD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,CAMA;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAqB7D;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,kBAAkB,CAAC,CAQ7B;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,UAAU,CAAC,CAErB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,UAAU,CAAC,CAErB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,eAAe,CAAC;AAExC;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,YAAY,CAAC,CAEvB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readScriptTables } from "../script/conversion.js";
|
|
2
2
|
import { Dictionary } from "./dictionary.js";
|
|
3
|
+
import { WordCounts } from "./word-counts.js";
|
|
3
4
|
/**
|
|
4
5
|
* The three files a tier is made of.
|
|
5
6
|
*/
|
|
@@ -58,6 +59,29 @@ export async function loadArtifact(source, tier) {
|
|
|
58
59
|
export async function loadDictionary(source, tier) {
|
|
59
60
|
return Dictionary.from(await loadArtifact(source, tier));
|
|
60
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* The file the raw corpus counts live in.
|
|
64
|
+
*
|
|
65
|
+
* `full` alone, and outside the tiers rather than one per tier: a caller
|
|
66
|
+
* ranking words wants the whole vocabulary ordered, and a ranking over part of
|
|
67
|
+
* it answers a different question.
|
|
68
|
+
*/
|
|
69
|
+
export const COUNTS_FILE = "full.counts";
|
|
70
|
+
/**
|
|
71
|
+
* Load the raw corpus counts for the `full` tier.
|
|
72
|
+
*
|
|
73
|
+
* Separate from the dictionary for the same reason {@link loadScriptTables} is.
|
|
74
|
+
* Nothing on the decoding path reads counts, and the quantised frequencies the
|
|
75
|
+
* decoder does read already ship inside every tier. This file is 243 KB brotli
|
|
76
|
+
* against `full.freq`'s 148 KB, and only a caller that asks for it pays.
|
|
77
|
+
*
|
|
78
|
+
* The counts are positional over the `full` tier's keys, so pair them with a
|
|
79
|
+
* `full` {@link Dictionary} and nothing else. {@link WordCounts.size} and
|
|
80
|
+
* {@link Dictionary.size} agree where the two match.
|
|
81
|
+
*/
|
|
82
|
+
export async function loadWordCounts(source) {
|
|
83
|
+
return WordCounts.from(await source.bytes(COUNTS_FILE));
|
|
84
|
+
}
|
|
61
85
|
/**
|
|
62
86
|
* The file the script conversion tables live in.
|
|
63
87
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/dictionary/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,yBAAyB,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/dictionary/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,yBAAyB,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,UAAU,E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AAY,CAChC,MAAwB,EACxB,IAAU;IAEV,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACrD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QACvB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;QAC1B,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC;KAChC,CAAC,CAAC;IACH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAwB,EACxB,IAAU;IAEV,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAwB;IAExB,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAwB;IAExB,OAAO,gBAAgB,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { DictionaryEntry } from "./entry.js";
|
|
2
|
+
/**
|
|
3
|
+
* Corpus counts for every key of a tier, one variable-length integer each.
|
|
4
|
+
*
|
|
5
|
+
* Counts are positional in the same sense the frequency table is: entry *n*
|
|
6
|
+
* describes the key at position *n* of the matching
|
|
7
|
+
* {@link import("./key-index.js").KeyIndex}, which is what
|
|
8
|
+
* {@link import("./dictionary.js").Dictionary.wordAt} reads.
|
|
9
|
+
*
|
|
10
|
+
* The encoding is LEB128, measured against the alternatives on the full tier's
|
|
11
|
+
* 723,147 keys. It takes 747 KB, and 243 KB brotli, where a fixed 32-bit array
|
|
12
|
+
* takes 2,825 KB and 299 KB and decimal text takes 1,586 KB and 281 KB. Two
|
|
13
|
+
* thirds of the keys are attested nowhere and most of the rest carry a small
|
|
14
|
+
* count, and a fixed width pays for the maximum on all of them.
|
|
15
|
+
*
|
|
16
|
+
* Unlike the rest of the artifact this *is* parsed on load, into one typed
|
|
17
|
+
* array. Nothing in a browser reads it, so the load cost buys a random access
|
|
18
|
+
* that a varint stream cannot otherwise give.
|
|
19
|
+
*/
|
|
20
|
+
export declare class WordCounts {
|
|
21
|
+
#private;
|
|
22
|
+
/**
|
|
23
|
+
* Encode raw counts, in key order.
|
|
24
|
+
*
|
|
25
|
+
* A count of zero means the word is attested nowhere in the corpus, which is
|
|
26
|
+
* a fact about the word and is stored as one. Fractions and negatives are
|
|
27
|
+
* floored into range rather than rejected, since a source that supplies one
|
|
28
|
+
* has already been through the merge.
|
|
29
|
+
*/
|
|
30
|
+
static build(counts: readonly number[]): WordCounts;
|
|
31
|
+
/**
|
|
32
|
+
* Decode packed bytes read back from an artifact.
|
|
33
|
+
*
|
|
34
|
+
* How many counts there are is a property of the stream rather than an
|
|
35
|
+
* argument, since every count ends at the first byte without a continuation
|
|
36
|
+
* bit. A truncated stream ends mid-count, and the trailing bytes are dropped
|
|
37
|
+
* rather than reported as a value the file never held.
|
|
38
|
+
*/
|
|
39
|
+
static from(packed: Uint8Array): WordCounts;
|
|
40
|
+
/**
|
|
41
|
+
* Hold decoded counts beside the bytes they came from. Use
|
|
42
|
+
* {@link WordCounts.build} or {@link WordCounts.from}.
|
|
43
|
+
*/
|
|
44
|
+
private constructor();
|
|
45
|
+
/**
|
|
46
|
+
* How many keys the counts describe.
|
|
47
|
+
*
|
|
48
|
+
* Worth checking against {@link import("./dictionary.js").Dictionary.size}
|
|
49
|
+
* before pairing the two by position. The counts are built for one tier, and
|
|
50
|
+
* against any other tier every position would name a different word.
|
|
51
|
+
*/
|
|
52
|
+
get size(): number;
|
|
53
|
+
/**
|
|
54
|
+
* Corpus occurrences of the key at a position.
|
|
55
|
+
*
|
|
56
|
+
* Positions outside the table report zero, which is what an unattested word
|
|
57
|
+
* reports, so a caller ranking by count sorts a missing key to the bottom.
|
|
58
|
+
*/
|
|
59
|
+
countOf(at: number): number;
|
|
60
|
+
/**
|
|
61
|
+
* The packed bytes, ready to be written out.
|
|
62
|
+
*/
|
|
63
|
+
serialise(): Uint8Array;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Compile the counts artifact from merged entries.
|
|
67
|
+
*
|
|
68
|
+
* The keys are claimed and ordered the way `artifact.ts` claims and orders
|
|
69
|
+
* them, so position *n* here is position *n* there. Only the `full` tier is
|
|
70
|
+
* written: a caller ranking words wants the whole vocabulary ordered, and a
|
|
71
|
+
* ranking over part of it answers a different question.
|
|
72
|
+
*/
|
|
73
|
+
export declare function buildWordCounts(entries: readonly DictionaryEntry[]): WordCounts;
|
|
74
|
+
//# sourceMappingURL=word-counts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"word-counts.d.ts","sourceRoot":"","sources":["../../src/dictionary/word-counts.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAelD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,UAAU;;IACrB;;;;;;;OAOG;IACH,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CAgBlD;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAkB1C;IAKD;;;OAGG;IACH,OAAO,eAGN;IAED;;;;;;OAMG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;;;OAKG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAE1B;IAED;;OAEG;IACH,SAAS,IAAI,UAAU,CAEtB;CACF;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,UAAU,CAIZ"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Raw corpus counts, kept beside the quantised table rather than inside it.
|
|
3
|
+
*
|
|
4
|
+
* {@link import("./frequency-table.js").FrequencyTable} packs a count into four
|
|
5
|
+
* bits, because 16 buckets are all the decoder compares and they cost 9 KB
|
|
6
|
+
* where raw single-byte counts cost 23 KB. A caller ranking words against each
|
|
7
|
+
* other needs what that packing throws away. Rank the 120,858 CC-CEDICT
|
|
8
|
+
* headwords the full tier holds by `cost` and 5,934 of them land on the value
|
|
9
|
+
* at rank 10,000, so which words make a top-10,000 cut is decided by codepoint
|
|
10
|
+
* order. Rank the same words on the counts those buckets were quantised from
|
|
11
|
+
* and the tie at that rank is 16 words wide.
|
|
12
|
+
*
|
|
13
|
+
* So this is a second artifact, read by a caller that asks for it and by
|
|
14
|
+
* nothing on the decoding path. See `docs/dictionaries/` for the shape of it.
|
|
15
|
+
*/
|
|
16
|
+
import { claimKeys, orderedClaims } from "./artifact-claims.js";
|
|
17
|
+
/**
|
|
18
|
+
* The largest count that survives a round trip, which is 32 bits of varint.
|
|
19
|
+
*
|
|
20
|
+
* jieba's busiest word is attested 883,634 times, which leaves the ceiling
|
|
21
|
+
* three orders of magnitude clear of anything the corpus holds. It bounds the
|
|
22
|
+
* encoder rather than rejecting data.
|
|
23
|
+
*/
|
|
24
|
+
const MAX_COUNT = 0xff_ff_ff_ff;
|
|
25
|
+
const CONTINUATION = 0x80;
|
|
26
|
+
const PAYLOAD = 0x7f;
|
|
27
|
+
const SHIFT = 7;
|
|
28
|
+
/**
|
|
29
|
+
* Corpus counts for every key of a tier, one variable-length integer each.
|
|
30
|
+
*
|
|
31
|
+
* Counts are positional in the same sense the frequency table is: entry *n*
|
|
32
|
+
* describes the key at position *n* of the matching
|
|
33
|
+
* {@link import("./key-index.js").KeyIndex}, which is what
|
|
34
|
+
* {@link import("./dictionary.js").Dictionary.wordAt} reads.
|
|
35
|
+
*
|
|
36
|
+
* The encoding is LEB128, measured against the alternatives on the full tier's
|
|
37
|
+
* 723,147 keys. It takes 747 KB, and 243 KB brotli, where a fixed 32-bit array
|
|
38
|
+
* takes 2,825 KB and 299 KB and decimal text takes 1,586 KB and 281 KB. Two
|
|
39
|
+
* thirds of the keys are attested nowhere and most of the rest carry a small
|
|
40
|
+
* count, and a fixed width pays for the maximum on all of them.
|
|
41
|
+
*
|
|
42
|
+
* Unlike the rest of the artifact this *is* parsed on load, into one typed
|
|
43
|
+
* array. Nothing in a browser reads it, so the load cost buys a random access
|
|
44
|
+
* that a varint stream cannot otherwise give.
|
|
45
|
+
*/
|
|
46
|
+
export class WordCounts {
|
|
47
|
+
/**
|
|
48
|
+
* Encode raw counts, in key order.
|
|
49
|
+
*
|
|
50
|
+
* A count of zero means the word is attested nowhere in the corpus, which is
|
|
51
|
+
* a fact about the word and is stored as one. Fractions and negatives are
|
|
52
|
+
* floored into range rather than rejected, since a source that supplies one
|
|
53
|
+
* has already been through the merge.
|
|
54
|
+
*/
|
|
55
|
+
static build(counts) {
|
|
56
|
+
const values = Uint32Array.from(counts, (count) => Number.isFinite(count) ? Math.min(MAX_COUNT, Math.max(0, count)) : 0);
|
|
57
|
+
const packed = [];
|
|
58
|
+
for (const value of values) {
|
|
59
|
+
let remaining = value;
|
|
60
|
+
do {
|
|
61
|
+
const byte = remaining & PAYLOAD;
|
|
62
|
+
remaining >>>= SHIFT;
|
|
63
|
+
packed.push(remaining > 0 ? byte | CONTINUATION : byte);
|
|
64
|
+
} while (remaining > 0);
|
|
65
|
+
}
|
|
66
|
+
return new WordCounts(values, Uint8Array.from(packed));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Decode packed bytes read back from an artifact.
|
|
70
|
+
*
|
|
71
|
+
* How many counts there are is a property of the stream rather than an
|
|
72
|
+
* argument, since every count ends at the first byte without a continuation
|
|
73
|
+
* bit. A truncated stream ends mid-count, and the trailing bytes are dropped
|
|
74
|
+
* rather than reported as a value the file never held.
|
|
75
|
+
*/
|
|
76
|
+
static from(packed) {
|
|
77
|
+
const values = [];
|
|
78
|
+
let value = 0;
|
|
79
|
+
let shift = 0;
|
|
80
|
+
for (const byte of packed) {
|
|
81
|
+
// `+` rather than `|`, which is signed and would wrap the top bit of a
|
|
82
|
+
// 32-bit count into a negative number.
|
|
83
|
+
value += (byte & PAYLOAD) * 2 ** shift;
|
|
84
|
+
if ((byte & CONTINUATION) === 0) {
|
|
85
|
+
values.push(value);
|
|
86
|
+
value = 0;
|
|
87
|
+
shift = 0;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
shift += SHIFT;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return new WordCounts(Uint32Array.from(values), packed);
|
|
94
|
+
}
|
|
95
|
+
#counts;
|
|
96
|
+
#packed;
|
|
97
|
+
/**
|
|
98
|
+
* Hold decoded counts beside the bytes they came from. Use
|
|
99
|
+
* {@link WordCounts.build} or {@link WordCounts.from}.
|
|
100
|
+
*/
|
|
101
|
+
constructor(counts, packed) {
|
|
102
|
+
this.#counts = counts;
|
|
103
|
+
this.#packed = packed;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* How many keys the counts describe.
|
|
107
|
+
*
|
|
108
|
+
* Worth checking against {@link import("./dictionary.js").Dictionary.size}
|
|
109
|
+
* before pairing the two by position. The counts are built for one tier, and
|
|
110
|
+
* against any other tier every position would name a different word.
|
|
111
|
+
*/
|
|
112
|
+
get size() {
|
|
113
|
+
return this.#counts.length;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Corpus occurrences of the key at a position.
|
|
117
|
+
*
|
|
118
|
+
* Positions outside the table report zero, which is what an unattested word
|
|
119
|
+
* reports, so a caller ranking by count sorts a missing key to the bottom.
|
|
120
|
+
*/
|
|
121
|
+
countOf(at) {
|
|
122
|
+
return this.#counts[at] ?? 0;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The packed bytes, ready to be written out.
|
|
126
|
+
*/
|
|
127
|
+
serialise() {
|
|
128
|
+
return this.#packed;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Compile the counts artifact from merged entries.
|
|
133
|
+
*
|
|
134
|
+
* The keys are claimed and ordered the way `artifact.ts` claims and orders
|
|
135
|
+
* them, so position *n* here is position *n* there. Only the `full` tier is
|
|
136
|
+
* written: a caller ranking words wants the whole vocabulary ordered, and a
|
|
137
|
+
* ranking over part of it answers a different question.
|
|
138
|
+
*/
|
|
139
|
+
export function buildWordCounts(entries) {
|
|
140
|
+
return WordCounts.build(orderedClaims(claimKeys(entries)).map(([, entry]) => entry.frequency));
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=word-counts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"word-counts.js","sourceRoot":"","sources":["../../src/dictionary/word-counts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGhE;;;;;;GAMG;AACH,MAAM,SAAS,GAAG,aAAa,CAAC;AAEhC,MAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,MAAM,KAAK,GAAG,CAAC,CAAC;AAEhB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,UAAU;IACrB;;;;;;;OAOG;IACH,MAAM,CAAC,KAAK,CAAC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G,CAAC,CAAC;gBACV,KAAK,GAAG,CAAC,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACN,KAAK,IAAI,KAAK,CAAC;YACjB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IAC1D,CAAC;IAEQ,OAAO,CAAc;IACrB,OAAO,CAAa;IAE7B;;;OAGG;IACH,YAAoB,MAAmB,EAAE,MAAkB;QACzD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;;;;OAMG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAmC;IAEnC,OAAO,UAAU,CAAC,KAAK,CACrB,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CACtE,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export { isSameReading, isSameSyllable } from "./dictionary/entry.js";
|
|
|
13
13
|
export type { DictionaryEntry, EntryReadings } from "./dictionary/entry.js";
|
|
14
14
|
export { attachErhua, isErFinal, NON_ERHUA_ER_WORDS, withErhua, } from "./dictionary/erhua.js";
|
|
15
15
|
export { FREQUENCY_BUCKETS, FrequencyTable, } from "./dictionary/frequency-table.js";
|
|
16
|
+
export { buildWordCounts, WordCounts } from "./dictionary/word-counts.js";
|
|
16
17
|
export { KeyIndex } from "./dictionary/key-index.js";
|
|
17
18
|
export type { KeyLookup } from "./dictionary/key-index.js";
|
|
18
19
|
export { mergeSources } from "./dictionary/merge.js";
|
|
@@ -25,7 +26,7 @@ export { pairScripts, TraditionalTable } from "./dictionary/traditional.js";
|
|
|
25
26
|
export type { ScriptPairing } from "./dictionary/traditional.js";
|
|
26
27
|
export { Dictionary } from "./dictionary/dictionary.js";
|
|
27
28
|
export type { DictionaryReadings, WordEntry } from "./dictionary/dictionary.js";
|
|
28
|
-
export { fetchSource, loadArtifact, loadDictionary, loadScriptTables, SCRIPT_FILE, tierFiles, } from "./dictionary/source.js";
|
|
29
|
+
export { COUNTS_FILE, fetchSource, loadArtifact, loadDictionary, loadScriptTables, loadWordCounts, SCRIPT_FILE, tierFiles, } from "./dictionary/source.js";
|
|
29
30
|
export type { DictionarySource } from "./dictionary/source.js";
|
|
30
31
|
export { convert, convertGreedily, convertPieces, joinPieces, } from "./decode/convert.js";
|
|
31
32
|
export type { ConvertedPiece, ConvertOptions } from "./decode/convert.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,aAAa,EACb,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,UAAU,GACX,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAA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YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EACL,aAAa,EACb,cAAc,EACd,aAAa,GACd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC/E,YAAY,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,13 +10,14 @@ export { BUILD_ASSERTIONS, BuiltDictionary, checkBuild, } from "./dictionary/ass
|
|
|
10
10
|
export { isSameReading, isSameSyllable } from "./dictionary/entry.js";
|
|
11
11
|
export { attachErhua, isErFinal, NON_ERHUA_ER_WORDS, withErhua, } from "./dictionary/erhua.js";
|
|
12
12
|
export { FREQUENCY_BUCKETS, FrequencyTable, } from "./dictionary/frequency-table.js";
|
|
13
|
+
export { buildWordCounts, WordCounts } from "./dictionary/word-counts.js";
|
|
13
14
|
export { KeyIndex } from "./dictionary/key-index.js";
|
|
14
15
|
export { mergeSources } from "./dictionary/merge.js";
|
|
15
16
|
export { OVERRIDE_READINGS, READING_OVERRIDES, readOverrideReading, } from "./dictionary/overrides.js";
|
|
16
17
|
export { readAlignedReading, readDictionaryReading, } from "./dictionary/reading.js";
|
|
17
18
|
export { pairScripts, TraditionalTable } from "./dictionary/traditional.js";
|
|
18
19
|
export { Dictionary } from "./dictionary/dictionary.js";
|
|
19
|
-
export { fetchSource, loadArtifact, loadDictionary, loadScriptTables, SCRIPT_FILE, tierFiles, } from "./dictionary/source.js";
|
|
20
|
+
export { COUNTS_FILE, fetchSource, loadArtifact, loadDictionary, loadScriptTables, loadWordCounts, SCRIPT_FILE, tierFiles, } from "./dictionary/source.js";
|
|
20
21
|
export { convert, convertGreedily, convertPieces, joinPieces, } from "./decode/convert.js";
|
|
21
22
|
export { isUncertain, scoreReadings } from "./decode/confidence.js";
|
|
22
23
|
export { decodeReadings, decodeRun, decodeRunScored, decodeSpacing, } from "./decode/decode.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,aAAa,EACb,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,UAAU,GACX,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGtE,OAAO,EACL,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,SAAS,GACV,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,cAAc,GACf,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAOrD,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG5E,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAGxD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,SAAS,GACV,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,OAAO,EACP,eAAe,EACf,aAAa,EACb,UAAU,GACX,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAOpE,OAAO,EACL,cAAc,EACd,SAAS,EACT,eAAe,EACf,aAAa,GACd,MAAM,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