@kensio/pinyinjs 1.7.6 → 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.
Files changed (127) hide show
  1. package/README.md +2 -2
  2. package/data/full.counts +0 -0
  3. package/data/full.entries +46 -46
  4. package/data/manifest.json +15 -8
  5. package/data/script.map +102 -0
  6. package/data/standard.entries +8 -8
  7. package/dist/decode/chang-complement.d.ts +19 -0
  8. package/dist/decode/chang-complement.d.ts.map +1 -0
  9. package/dist/decode/chang-complement.js +113 -0
  10. package/dist/decode/chang-complement.js.map +1 -0
  11. package/dist/decode/chang-context.d.ts +9 -7
  12. package/dist/decode/chang-context.d.ts.map +1 -1
  13. package/dist/decode/chang-context.js +36 -3
  14. package/dist/decode/chang-context.js.map +1 -1
  15. package/dist/decode/chang-rule.d.ts +25 -15
  16. package/dist/decode/chang-rule.d.ts.map +1 -1
  17. package/dist/decode/chang-rule.js +38 -19
  18. package/dist/decode/chang-rule.js.map +1 -1
  19. package/dist/decode/convert-pipeline.d.ts.map +1 -1
  20. package/dist/decode/convert-pipeline.js +3 -3
  21. package/dist/decode/convert-pipeline.js.map +1 -1
  22. package/dist/decode/de-rule.d.ts +20 -0
  23. package/dist/decode/de-rule.d.ts.map +1 -1
  24. package/dist/decode/de-rule.js +87 -1
  25. package/dist/decode/de-rule.js.map +1 -1
  26. package/dist/decode/decode.d.ts +12 -25
  27. package/dist/decode/decode.d.ts.map +1 -1
  28. package/dist/decode/decode.js +10 -47
  29. package/dist/decode/decode.js.map +1 -1
  30. package/dist/decode/decoders.d.ts +9 -4
  31. package/dist/decode/decoders.d.ts.map +1 -1
  32. package/dist/decode/decoders.js +7 -7
  33. package/dist/decode/decoders.js.map +1 -1
  34. package/dist/decode/edge-context.d.ts +19 -0
  35. package/dist/decode/edge-context.d.ts.map +1 -1
  36. package/dist/decode/edge-context.js +41 -0
  37. package/dist/decode/edge-context.js.map +1 -1
  38. package/dist/decode/lattice-decode.d.ts +28 -0
  39. package/dist/decode/lattice-decode.d.ts.map +1 -0
  40. package/dist/decode/lattice-decode.js +48 -0
  41. package/dist/decode/lattice-decode.js.map +1 -0
  42. package/dist/decode/lattice-slice.d.ts +22 -6
  43. package/dist/decode/lattice-slice.d.ts.map +1 -1
  44. package/dist/decode/lattice-slice.js +24 -18
  45. package/dist/decode/lattice-slice.js.map +1 -1
  46. package/dist/decode/numbers.d.ts +0 -8
  47. package/dist/decode/numbers.d.ts.map +1 -1
  48. package/dist/decode/numbers.js +0 -10
  49. package/dist/decode/numbers.js.map +1 -1
  50. package/dist/decode/reading-rules.d.ts +1 -1
  51. package/dist/decode/reading-rules.d.ts.map +1 -1
  52. package/dist/decode/reading-rules.js +3 -2
  53. package/dist/decode/reading-rules.js.map +1 -1
  54. package/dist/decode/rules.d.ts +1 -1
  55. package/dist/decode/rules.d.ts.map +1 -1
  56. package/dist/decode/rules.js +1 -1
  57. package/dist/decode/rules.js.map +1 -1
  58. package/dist/decode/run-context.d.ts +33 -0
  59. package/dist/decode/run-context.d.ts.map +1 -0
  60. package/dist/decode/run-context.js +47 -0
  61. package/dist/decode/run-context.js.map +1 -0
  62. package/dist/decode/run-lattice.d.ts +13 -10
  63. package/dist/decode/run-lattice.d.ts.map +1 -1
  64. package/dist/decode/run-lattice.js +15 -12
  65. package/dist/decode/run-lattice.js.map +1 -1
  66. package/dist/decode/script-region.d.ts +15 -0
  67. package/dist/decode/script-region.d.ts.map +1 -0
  68. package/dist/decode/script-region.js +61 -0
  69. package/dist/decode/script-region.js.map +1 -0
  70. package/dist/decode/script-types.d.ts +11 -2
  71. package/dist/decode/script-types.d.ts.map +1 -1
  72. package/dist/decode/script-types.js +2 -1
  73. package/dist/decode/script-types.js.map +1 -1
  74. package/dist/decode/script-words.d.ts +7 -5
  75. package/dist/decode/script-words.d.ts.map +1 -1
  76. package/dist/decode/script-words.js +18 -25
  77. package/dist/decode/script-words.js.map +1 -1
  78. package/dist/decode/script.d.ts.map +1 -1
  79. package/dist/decode/script.js +2 -1
  80. package/dist/decode/script.js.map +1 -1
  81. package/dist/dictionary/artifact-claims.d.ts +8 -0
  82. package/dist/dictionary/artifact-claims.d.ts.map +1 -1
  83. package/dist/dictionary/artifact-claims.js +11 -1
  84. package/dist/dictionary/artifact-claims.js.map +1 -1
  85. package/dist/dictionary/artifact.d.ts.map +1 -1
  86. package/dist/dictionary/artifact.js +3 -5
  87. package/dist/dictionary/artifact.js.map +1 -1
  88. package/dist/dictionary/measure-tone.d.ts +36 -0
  89. package/dist/dictionary/measure-tone.d.ts.map +1 -0
  90. package/dist/dictionary/measure-tone.js +139 -0
  91. package/dist/dictionary/measure-tone.js.map +1 -0
  92. package/dist/dictionary/merge-types.d.ts +8 -3
  93. package/dist/dictionary/merge-types.d.ts.map +1 -1
  94. package/dist/dictionary/merge-types.js.map +1 -1
  95. package/dist/dictionary/merge.d.ts.map +1 -1
  96. package/dist/dictionary/merge.js +7 -1
  97. package/dist/dictionary/merge.js.map +1 -1
  98. package/dist/dictionary/overrides.d.ts +5 -0
  99. package/dist/dictionary/overrides.d.ts.map +1 -1
  100. package/dist/dictionary/overrides.js +5 -5
  101. package/dist/dictionary/overrides.js.map +1 -1
  102. package/dist/dictionary/script-tables.js +91 -13
  103. package/dist/dictionary/script-tables.js.map +1 -1
  104. package/dist/dictionary/source.d.ts +22 -0
  105. package/dist/dictionary/source.d.ts.map +1 -1
  106. package/dist/dictionary/source.js +24 -0
  107. package/dist/dictionary/source.js.map +1 -1
  108. package/dist/dictionary/word-counts.d.ts +74 -0
  109. package/dist/dictionary/word-counts.d.ts.map +1 -0
  110. package/dist/dictionary/word-counts.js +142 -0
  111. package/dist/dictionary/word-counts.js.map +1 -0
  112. package/dist/dictionary/word-readings.d.ts.map +1 -1
  113. package/dist/dictionary/word-readings.js +3 -0
  114. package/dist/dictionary/word-readings.js.map +1 -1
  115. package/dist/index.d.ts +3 -2
  116. package/dist/index.d.ts.map +1 -1
  117. package/dist/index.js +3 -2
  118. package/dist/index.js.map +1 -1
  119. package/dist/script/glyphs.d.ts +9 -8
  120. package/dist/script/glyphs.d.ts.map +1 -1
  121. package/dist/script/glyphs.js +21 -48
  122. package/dist/script/glyphs.js.map +1 -1
  123. package/dist/script/reading-splits.d.ts +41 -0
  124. package/dist/script/reading-splits.d.ts.map +1 -0
  125. package/dist/script/reading-splits.js +98 -0
  126. package/dist/script/reading-splits.js.map +1 -0
  127. package/package.json +1 -1
@@ -0,0 +1,36 @@
1
+ import { type Tone } from "../tone/tone.js";
2
+ import type { DictionaryEntry } from "./entry.js";
3
+ /**
4
+ * The determiners that take 个 into a word of their own, where it is 轻声.
5
+ *
6
+ * Six characters and not a part of speech, because the tag cannot draw the
7
+ * line. jieba tags 这个, 那个 and 每个 `r` and tags 各个, 某个 and 整个 `r` as
8
+ * well, and those three are `gègè`, `mǒugè` and `zhěnggè` in both sources with
9
+ * nothing disagreeing. So this is a list of judgements, in the way
10
+ * {@link import("./neutral-senses.js").NEUTRAL_SENSE_WORDS} is, and the words
11
+ * it decides are the ones where a source writes the 轻声 on the determiner and
12
+ * the pair together.
13
+ */
14
+ export declare const NEUTRAL_MEASURE_DETERMINERS: ReadonlySet<string>;
15
+ /**
16
+ * The tone the 个 at a position takes, or undefined where nothing settles it.
17
+ */
18
+ export declare function countingToneAt(characters: readonly string[], at: number): Tone | undefined;
19
+ /**
20
+ * What the settling pass changed.
21
+ */
22
+ export interface MeasureToneSettlement {
23
+ readonly entries: readonly DictionaryEntry[];
24
+ /** Entries whose 个 was retoned. */
25
+ readonly settled: number;
26
+ }
27
+ /**
28
+ * Give every 个 the tone its position calls for.
29
+ *
30
+ * Runs over the finished entries, before the constituent repair, so that a
31
+ * phrase held to the words inside it is held to a settled reading. Only the
32
+ * 普通话 reading is touched. A zh-TW delta is a claim about how 國語 differs
33
+ * from what stands beside it, and none of the 279 entries holding a 个 has one.
34
+ */
35
+ export declare function settleMeasureTones(entries: readonly DictionaryEntry[]): MeasureToneSettlement;
36
+ //# sourceMappingURL=measure-tone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"measure-tone.d.ts","sourceRoot":"","sources":["../../src/dictionary/measure-tone.ts"],"names":[],"mappings":"AA6CA,OAAO,EAAgB,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAYlD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,2BAA2B,EAAE,WAAW,CAAC,MAAM,CAQ1D,CAAC;AAgBH;;GAEG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,EAAE,EAAE,MAAM,GACT,IAAI,GAAG,SAAS,CAQlB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IAC7C,mCAAmC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,qBAAqB,CAsCvB"}
@@ -0,0 +1,139 @@
1
+ /**
2
+ * Settling the tone of 个, which no source settles for itself.
3
+ *
4
+ * Every source writes 个 both ways, and where one writes the 轻声 it is a
5
+ * choice made an entry at a time. CC-CEDICT has 一个 `ge5` beside 一个人 `ge4`,
6
+ * 那个 `ge5` beside 那个人 `ge4`, 上个 `ge5` beside 上个月 `ge4`, and 每个 `ge4`
7
+ * beside 每个人 `ge5`. large_pinyin wanders the same way over 半个 and 半个人,
8
+ * and over 这个 and 这些个. No reading of sense separates them, because there is
9
+ * no difference of sense to read: 那个人 is 那个 followed by 人.
10
+ *
11
+ * The sources do agree on the proportion. The full tone is the large majority in
12
+ * all three. 现代汉语频率词典 counts 个 as `gè` 11,693 times against `ge` 1,891
13
+ * (Unihan's `kHanyuPinlu`), large_pinyin writes 243 against 36, and CC-CEDICT
14
+ * 102 against 45. So the package writes the tone and names the exception.
15
+ *
16
+ * **A numeral in front of it means the 量词 is counting**, and a counting 个 is
17
+ * written `gè`: 一个, 两个, 十二个, 一百个, and 一个人 and 上一个 with them.
18
+ * This is what the gold corpus already asserts for every 个 it holds, and what
19
+ * the 一个 override used to state on its own.
20
+ *
21
+ * **The exception is the determiners.** 这个, 那个 and 哪个 are headwords in
22
+ * 现代汉语词典 read `zhège`, `nàge` and `nǎge`, and both sources write them 轻声
23
+ * wherever the pair stands on its own. 每个, 上个 and 下个 are the same
24
+ * determiner shape and the sources split on them by length: CC-CEDICT has 上个
25
+ * `ge5` beside 上个月 `ge4`, and 每个 `ge4` beside 每个人 `ge5`. The 轻声 is taken
26
+ * for all six, which is what 那个人, 每个人 and 上个月 are said with.
27
+ *
28
+ * Everything else keeps the reading its source gave it. 几个, 半个, 多个 and
29
+ * 单个 have neither a numeral nor a listed determiner in front of them, so their
30
+ * 轻声 stands. So does the colloquial 个 of 我勒个去 and 一口吃个胖子, which
31
+ * counts nothing, and the 北京话 今儿个, 明儿个 and 昨儿个, whose 儿 folds into
32
+ * the syllable before it and leaves the reading shorter than the key.
33
+ *
34
+ * Measured over the committed dictionary it retones 25 entries of the 279 that
35
+ * hold a 个. Over the 88,866 lines of Tatoeba and zh.wikipedia the reading
36
+ * rules were sized against it moves 339 conversions, and every one is a 个:
37
+ * 每个 106, 那个 63, 下个月 and 下个星期 62, 上个月 and 上个星期 60, and 35
38
+ * where 一个 gains its tone and the 一 sandhi that follows from it. Before the
39
+ * pass, 2,467 of the corpus's 5,397 个 sat after a character the package read
40
+ * both ways; after it, 204 do, and all of those are positions no key covers,
41
+ * where the decode falls back to the character's own `gè`.
42
+ */
43
+ import { QUANTITY_CHARACTERS } from "../numerals/characters.js";
44
+ import { toCharacters } from "../script/characters.js";
45
+ import { NEUTRAL_TONE } from "../tone/tone.js";
46
+ /**
47
+ * The 量词 this settles, in both scripts.
48
+ */
49
+ const MEASURE_CHARACTERS = new Set(["个", "個"]);
50
+ /**
51
+ * The tone a counting 个 carries.
52
+ */
53
+ const COUNTING_TONE = 4;
54
+ /**
55
+ * The determiners that take 个 into a word of their own, where it is 轻声.
56
+ *
57
+ * Six characters and not a part of speech, because the tag cannot draw the
58
+ * line. jieba tags 这个, 那个 and 每个 `r` and tags 各个, 某个 and 整个 `r` as
59
+ * well, and those three are `gègè`, `mǒugè` and `zhěnggè` in both sources with
60
+ * nothing disagreeing. So this is a list of judgements, in the way
61
+ * {@link import("./neutral-senses.js").NEUTRAL_SENSE_WORDS} is, and the words
62
+ * it decides are the ones where a source writes the 轻声 on the determiner and
63
+ * the pair together.
64
+ */
65
+ export const NEUTRAL_MEASURE_DETERMINERS = new Set([
66
+ "这",
67
+ "這",
68
+ "那",
69
+ "哪",
70
+ "每",
71
+ "上",
72
+ "下",
73
+ ]);
74
+ /**
75
+ * Whether a syllable is the 量词 rather than 个's other reading.
76
+ *
77
+ * 独自个 is `dú zì gě`, and a `gě` retoned to `gè` would be a different word.
78
+ * Testing the syllable keeps it out without a list of the words it appears in.
79
+ */
80
+ function isCountingSyllable(syllable) {
81
+ return (syllable.initial === "g" &&
82
+ syllable.final === "e" &&
83
+ (syllable.tone === COUNTING_TONE || syllable.tone === NEUTRAL_TONE));
84
+ }
85
+ /**
86
+ * The tone the 个 at a position takes, or undefined where nothing settles it.
87
+ */
88
+ export function countingToneAt(characters, at) {
89
+ // Nothing stands in front of a 个 that starts the word, and nothing settles
90
+ // it there: 个人 is `gèrén` on its own account.
91
+ const before = characters[at - 1] ?? "";
92
+ if (NEUTRAL_MEASURE_DETERMINERS.has(before)) {
93
+ return NEUTRAL_TONE;
94
+ }
95
+ return QUANTITY_CHARACTERS.has(before) ? COUNTING_TONE : undefined;
96
+ }
97
+ /**
98
+ * Give every 个 the tone its position calls for.
99
+ *
100
+ * Runs over the finished entries, before the constituent repair, so that a
101
+ * phrase held to the words inside it is held to a settled reading. Only the
102
+ * 普通话 reading is touched. A zh-TW delta is a claim about how 國語 differs
103
+ * from what stands beside it, and none of the 279 entries holding a 个 has one.
104
+ */
105
+ export function settleMeasureTones(entries) {
106
+ let settled = 0;
107
+ const settle = (entry) => {
108
+ const characters = toCharacters(entry.hans);
109
+ const reading = entry.readings.cn;
110
+ // 儿化 folds two characters into one syllable, so a reading shorter than
111
+ // the word says nothing about which character each syllable reads.
112
+ if (reading.length !== characters.length) {
113
+ return entry;
114
+ }
115
+ const corrected = [...reading];
116
+ let isMoved = false;
117
+ for (const [at, syllable] of reading.entries()) {
118
+ if (
119
+ /* c8 ignore next -- the reading and the characters are the same length */
120
+ !MEASURE_CHARACTERS.has(characters[at] ?? "") ||
121
+ !isCountingSyllable(syllable)) {
122
+ continue;
123
+ }
124
+ const tone = countingToneAt(characters, at);
125
+ if (tone === undefined || syllable.tone === tone) {
126
+ continue;
127
+ }
128
+ corrected[at] = { ...syllable, tone };
129
+ isMoved = true;
130
+ }
131
+ if (!isMoved) {
132
+ return entry;
133
+ }
134
+ settled++;
135
+ return { ...entry, readings: { ...entry.readings, cn: corrected } };
136
+ };
137
+ return { entries: entries.map((entry) => settle(entry)), settled };
138
+ }
139
+ //# sourceMappingURL=measure-tone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"measure-tone.js","sourceRoot":"","sources":["../../src/dictionary/measure-tone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAa,MAAM,iBAAiB,CAAC;AAG1D;;GAEG;AACH,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAEpE;;GAEG;AACH,MAAM,aAAa,GAAG,CAAgB,CAAC;AAEvC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAA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G,KAAK,CAAC;QACpB,KAAK,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;YAC/C;YACE,0EAA0E;YAC1E,CAAC,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;gBAC7C,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAC7B,CAAC;gBACD,SAAS;YACX,CAAC;YACD,MAAM,IAAI,GAAG,cAAc,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAC5C,IAAI,IAAI,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;gBACjD,SAAS;YACX,CAAC;YACD,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,CAAC;YACtC,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC;IACtE,CAAC,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;AACrE,CAAC"}
@@ -36,6 +36,11 @@ export interface MergeStats {
36
36
  readonly reducedNeutrals: number;
37
37
  /** Words whose trailing 儿 was folded into the syllable before it. */
38
38
  readonly erhuaRepairs: number;
39
+ /**
40
+ * Entries whose 个 was retoned by its position — see
41
+ * {@link import("./measure-tone.js").settleMeasureTones}.
42
+ */
43
+ readonly settledMeasureTones: number;
39
44
  /** Words whose 繁體 form was derived rather than taken from CC-CEDICT. */
40
45
  readonly derivedTraditional: number;
41
46
  /** Entries with a 繁體 form differing from their 简体 one. */
@@ -90,9 +95,9 @@ export interface WordSources {
90
95
  * What one word contributed to the build's counts.
91
96
  *
92
97
  * The per-word view of {@link MergeStats}, minus the counts no single word can
93
- * move: `reducedNeutrals`, `repairedConstituents` and `composedTaiwanReadings`
94
- * are settled by passes over the whole dictionary, and `rejected` is counted by
95
- * the caller.
98
+ * move: `reducedNeutrals`, `settledMeasureTones`, `repairedConstituents` and
99
+ * `composedTaiwanReadings` are settled by passes over the whole dictionary, and
100
+ * `rejected` is counted by the caller.
96
101
  */
97
102
  export interface WordTally {
98
103
  readonly neutralToneCorrections: number;
@@ -1 +1 @@
1
- {"version":3,"file":"merge-types.d.ts","sourceRoot":"","sources":["../../src/dictionary/merge-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC7D,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;IACxD,QAAQ,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CA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CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/dictionary/merge.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAe,MAAM,kBAAkB,CAAC;AAE/E,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9E;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW,CAuD/D"}
1
+ {"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/dictionary/merge.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAe,MAAM,kBAAkB,CAAC;AAE/E,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9E;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW,CA6D/D"}
@@ -9,6 +9,7 @@ import { composeLocaleDeltas } from "./locale.js";
9
9
  import { indexCedict, senseLookup } from "./cedict-senses.js";
10
10
  import { buildCharacterDefaults } from "./character-defaults.js";
11
11
  import { repairConstituentReadings } from "./constituent-repair.js";
12
+ import { settleMeasureTones } from "./measure-tone.js";
12
13
  import { mergeWords, wordList } from "./merge-walk.js";
13
14
  /**
14
15
  * Build the merged dictionary from the four parsed sources.
@@ -38,11 +39,15 @@ export function mergeSources(sources) {
38
39
  defaults,
39
40
  };
40
41
  const { entries, rejected, counts } = mergeWords(wordList(phrase, defaults, cedictByWord, cedictByHant), wordSources);
42
+ // ── 个 given one tone per position ─────────────────────────
43
+ // Before the repair below, which reads a phrase's constituents off these same
44
+ // entries: settling first is what lets 那个人 be held to a settled 那个.
45
+ const measured = settleMeasureTones(entries);
41
46
  // ── Phrase entries held to the words inside them ───────────
42
47
  // Before the locale pass, which asks whether a compound reads a constituent
43
48
  // the way that constituent's own entry reads it. A phrase entry repaired here
44
49
  // answers yes where it used to answer no.
45
- const held = repairConstituentReadings(entries, senseLookup(cedictByWord, cedictByHant));
50
+ const held = repairConstituentReadings(measured.entries, senseLookup(cedictByWord, cedictByHant));
46
51
  // ── zh-TW deltas the sources marked only on a constituent ──
47
52
  // Last, because it segments each compound against the finished entries: the
48
53
  // readings, both scripts' keys and the frequencies all have to be settled
@@ -54,6 +59,7 @@ export function mergeSources(sources) {
54
59
  stats: {
55
60
  ...counts,
56
61
  reducedNeutrals,
62
+ settledMeasureTones: measured.settled,
57
63
  repairedConstituents: held.repaired,
58
64
  composedTaiwanReadings: localised.composed,
59
65
  rejected: rejected.size,
@@ -1 +1 @@
1
- {"version":3,"file":"merge.js","sourceRoot":"","sources":["../../src/dictionary/merge.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAKvD;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,OAAqB;IAChD,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IACnC,MAAM,YAAY,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACtE,6EAA6E;IAC7E,2EAA2E;IAC3E,0EAA0E;IAC1E,kCAAkC;IAClC,MAAM,YAAY,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAEvE,MAAM,EAAE,WAAW,EAAE,QAA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,YAAY,EAAE,YAAY,CAAC,CACxC,CAAC;IAEF,8DAA8D;IAC9D,4EAA4E;IAC5E,0EAA0E;IAC1E,qDAAqD;IACrD,MAAM,SAAS,GAAG,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEpD,OAAO;QACL,OAAO,EAAE,SAAS,CAAC,OAAO;QAC1B,QAAQ;QACR,KAAK,EAAE;YACL,GAAG,MAAM;YACT,eAAe;YACf,mBAAmB,EAAE,QAAQ,CAAC,OAAO;YACrC,oBAAoB,EAAE,IAAI,CAAC,QAAQ;YACnC,sBAAsB,EAAE,SAAS,CAAC,QAAQ;YAC1C,QAAQ,EAAE,QAAQ,CAAC,IAAI;SACxB;KACF,CAAC;AACJ,CAAC"}
@@ -29,6 +29,11 @@ export interface ReadingOverride {
29
29
  * {@link import("./neutral-senses.js").NEUTRAL_SENSE_WORDS} instead — that
30
30
  * table names the word and lets CC-CEDICT supply the reading, so nothing is
31
31
  * typed by hand that a source already holds.
32
+ *
33
+ * 一个 was listed here for `yī gè` until the whole of 个 was settled by
34
+ * position. One word taken out of a disagreement the sources have about 262 of
35
+ * them is a rule missing rather than an override earned, and the rule is
36
+ * {@link import("./measure-tone.js").settleMeasureTones}.
32
37
  */
33
38
  export declare const READING_OVERRIDES: readonly ReadingOverride[];
34
39
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"overrides.d.ts","sourceRoot":"","sources":["../../src/dictionary/overrides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGtE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,eAAe,EAavD,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,eAAe,GACxB,SAAS,QAAQ,EAAE,CAqBrB;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,CAMpE,CAAC"}
1
+ {"version":3,"file":"overrides.d.ts","sourceRoot":"","sources":["../../src/dictionary/overrides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGtE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,eAAe,EAOvD,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,eAAe,GACxB,SAAS,QAAQ,EAAE,CAqBrB;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,CAMpE,CAAC"}
@@ -19,6 +19,11 @@ import { NEUTRAL_TONE } from "../tone/tone.js";
19
19
  * {@link import("./neutral-senses.js").NEUTRAL_SENSE_WORDS} instead — that
20
20
  * table names the word and lets CC-CEDICT supply the reading, so nothing is
21
21
  * typed by hand that a source already holds.
22
+ *
23
+ * 一个 was listed here for `yī gè` until the whole of 个 was settled by
24
+ * position. One word taken out of a disagreement the sources have about 262 of
25
+ * them is a rule missing rather than an override earned, and the rule is
26
+ * {@link import("./measure-tone.js").settleMeasureTones}.
22
27
  */
23
28
  export const READING_OVERRIDES = [
24
29
  {
@@ -26,11 +31,6 @@ export const READING_OVERRIDES = [
26
31
  reading: "dài fu",
27
32
  reason: "Both sources give dà fū, the ancient court title. The everyday sense, doctor, is dàifu and is overwhelmingly the more common.",
28
33
  },
29
- {
30
- word: "一个",
31
- reading: "yī gè",
32
- reason: "Not a source defect but a real disagreement: CC-CEDICT has yi1 ge5 and large_pinyin has yí gè, and both are attested speech. Step 7 prefers CC-CEDICT on neutral tones, which is right for the other 771 words it settles and wrong here — 个 counting is written with its tone. Stored underlyingly, so the runtime sandhi pass writes yí gè.",
33
- },
34
34
  ];
35
35
  /**
36
36
  * Read an override's reading into syllables, throwing if it is malformed.
@@ -1 +1 @@
1
- {"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../src/dictionary/overrides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiB,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAc/C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA+B;IAC3D;QACE,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,QAAQ;QACjB,MAAM,EACJ,+HAA+H;KAClI;IACD;QACE,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,OAAO;QAChB,MAAM,EACJ,+UAA+U;KAClV;CACF,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAyB;IAEzB,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO;SAC/B,KAAK,CAAC,MAAM,CAAC;SACb,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC;SAC/B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IACvC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAA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AE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC;SAC/B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IACvC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,gBAAgB,QAAQ,CAAC,IAAI,iBAAiB,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,IAAI,GAAe,EAAE,CAAC;IAC5B,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CACb,gBAAgB,QAAQ,CAAC,IAAI,sBAAsB,QAAQ,CAAC,OAAO,EAAE,CACtE,CAAC;QACJ,CAAC;QACD,2EAA2E;QAC3E,oEAAoE;QACpE,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,YAAY,EAAE,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAC5B,IAAI,GAAG,CACL,iBAAiB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;IAClC,QAAQ,CAAC,IAAI;IACb,mBAAmB,CAAC,QAAQ,CAAC;CAC9B,CAAC,CACH,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { toCharacters } from "../script/characters.js";
2
- import { toCanonicalGlyphs } from "../script/glyphs.js";
2
+ import { CANONICAL_FORMS, toCanonicalGlyphs } from "../script/glyphs.js";
3
3
  import { convertCharacters } from "../script/conversion.js";
4
4
  import { alignedReadings, pairingsOf, tableOf, tally, } from "./script-pairings.js";
5
5
  /**
@@ -80,10 +80,78 @@ export function buildScriptTables(entries) {
80
80
  * 鹫峯寺 — and taking those at face value put 衞 and 峯 in the 简体-only set. A
81
81
  * text written 衞生 was then detected as 简体 and left alone when it was asked
82
82
  * for 简体, which is the opposite of what it needed.
83
+ *
84
+ * Occurrence alone is too strict, and that is what {@link writesCharacter}
85
+ * settles. A word list assembled from four sources holds a few headwords that
86
+ * failed to simplify — 见幾而作 and 极深研幾 are 简体 keys written with 幾 — and
87
+ * one of those was enough to take 幾 out of the 繁體-only set against the 297
88
+ * words that put it in. 衛 was out on the strength of a single 简体 headword
89
+ * against 394. So a script counts as writing a character when it writes it
90
+ * often enough to mean something, on the two-condition shape
91
+ * `deriveGlyphTables` already uses for the same kind of question.
92
+ *
93
+ * The variant forms are added afterwards, because normalising folds them away
94
+ * before anything is counted: every 裏 becomes 裡 on the way in, so 裏 occurs
95
+ * nowhere and settled nothing. Every key of `CANONICAL_FORMS` is 繁體 by
96
+ * construction — the variants 简体 writes were excluded from it, measured
97
+ * against CC-CEDICT's 简体 column — so the domain of that table is 繁體-only and
98
+ * joins the set wholesale.
99
+ *
100
+ * Measured against the dictionary's own paired headwords, which is 190,000
101
+ * labelled texts in two scripts: the multi-character pairs settle 99.13% of the
102
+ * time against 97.84% before, and 4 settle the wrong way. Checked against
103
+ * OpenCC's character tables, which no part of this is derived from, the 33
104
+ * characters that join the 简体 side all agree and 56 of the 60 judgeable ones
105
+ * joining the 繁體 side do. The four it disagrees about are 捝, 棁, 涚 and 蒀,
106
+ * which OpenCC lists in both its 简→繁 and 繁→简 tables and no corpus writes at
107
+ * all.
108
+ *
109
+ * 著 stays out of both, which is the honest answer rather than a miss: 简体
110
+ * writes it in its `zhù` sense — 专著, 显著, 著名 — and 繁體 writes it for that
111
+ * and for the aspect particle. 干, 台 and 里 are out for the same reason.
112
+ */
113
+ /**
114
+ * How many words a script must write a character in before it counts.
115
+ *
116
+ * The absolute floor, paired with {@link WRITTEN_SHARE} below. Both come from
117
+ * `deriveGlyphTables`, which asks the same question about a variant spelling
118
+ * and answers it with the same two conditions and the same numbers.
119
+ */
120
+ const WRITTEN_WORDS = 10;
121
+ /**
122
+ * The share of the other script's evidence that makes a handful count anyway.
123
+ *
124
+ * Without this a rare character would belong to neither script. 齶 is written
125
+ * in two 繁體 words and no 简体 one, which is 繁體-only however small the number,
126
+ * and a bare floor would throw it away along with 幾's two stray headwords.
127
+ */
128
+ const WRITTEN_SHARE = 0.05;
129
+ /**
130
+ * Whether a script writes a character often enough for it to mean anything.
131
+ *
132
+ * Two conditions, asking different questions. The floor asks whether the
133
+ * character is written at all in that script, and the share asks whether it is
134
+ * written *relative to the other script* — which is what separates 幾, at two
135
+ * 简体 headwords against 297 繁體 ones, from 著 at 36 against 733.
83
136
  */
137
+ /**
138
+ * Count each character of a word once, into a running tally.
139
+ */
140
+ function countCharacters(into, word) {
141
+ for (const character of toCharacters(word)) {
142
+ into.set(character, (into.get(character) ?? 0) + 1);
143
+ }
144
+ }
145
+ function writesCharacter(counts, other, character) {
146
+ const held = counts.get(character) ?? 0;
147
+ if (held === 0) {
148
+ return false;
149
+ }
150
+ return (held >= WRITTEN_WORDS || held > (other.get(character) ?? 0) * WRITTEN_SHARE);
151
+ }
84
152
  function scriptOnlyCharacters(entries) {
85
- const inHans = new Set();
86
- const inHant = new Set();
153
+ const inHans = new Map();
154
+ const inHant = new Map();
87
155
  for (const entry of entries) {
88
156
  // A 繁體 form that differs from the 简体 one only by glyph normalisation is
89
157
  // not evidence about script — 衞生 and 衛生 are two 繁體 spellings of one
@@ -95,18 +163,28 @@ function scriptOnlyCharacters(entries) {
95
163
  if (forms.length === 0) {
96
164
  continue;
97
165
  }
98
- const hansCharacters = toCharacters(canonicalHans);
99
- for (const character of hansCharacters) {
100
- inHans.add(character);
166
+ countCharacters(inHans, canonicalHans);
167
+ for (const form of forms) {
168
+ countCharacters(inHant, toCanonicalGlyphs(form));
101
169
  }
102
- const hantCharacters = forms.flatMap((form) => toCharacters(toCanonicalGlyphs(form)));
103
- for (const character of hantCharacters) {
104
- inHant.add(character);
170
+ }
171
+ const hansOnly = new Set();
172
+ const hantOnly = new Set();
173
+ for (const character of new Set([...inHans.keys(), ...inHant.keys()])) {
174
+ const hans = writesCharacter(inHans, inHant, character);
175
+ const hant = writesCharacter(inHant, inHans, character);
176
+ if (hans && !hant) {
177
+ hansOnly.add(character);
178
+ }
179
+ else if (hant && !hans) {
180
+ hantOnly.add(character);
105
181
  }
106
182
  }
107
- return {
108
- hansOnly: new Set([...inHans].filter((c) => !inHant.has(c))),
109
- hantOnly: new Set([...inHant].filter((c) => !inHans.has(c))),
110
- };
183
+ for (const variant of CANONICAL_FORMS.keys()) {
184
+ if (!hansOnly.has(variant)) {
185
+ hantOnly.add(variant);
186
+ }
187
+ }
188
+ return { hansOnly, hantOnly };
111
189
  }
112
190
  //# sourceMappingURL=script-tables.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"script-tables.js","sourceRoot":"","sources":["../../src/dictionary/script-tables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAqB,MAAM,yBAAyB,CAAC;AAE/E,OAAO,EACL,eAAe,EAEf,UAAU,EACV,OAAO,EACP,KAAK,GACN,MAAM,sBAAsB,CAAC;AAC9B;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAAmC;IAEnC,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAqB,CAAC;IACzD,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAqB,CAAC;IAExD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YACpD,KAAK,CAAC,mBAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;YAC/C,KAAK,CAAC,kBAAkB,EAAE,IAAI,EAA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E,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,KAAK,MAAM,SAAS,IAAI,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,EAAE,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;QACtE,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;QACxD,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;QACxD,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YAClB,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC1B,CAAC;aAAM,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACzB,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC;QAC7C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YAC3B,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAChC,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;AAEvC;;;;;;;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;C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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;AAkB7C;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAAU;IAKlC,OAAO;QACL,IAAI,EAAE,GAAG,IAAI,OAAO;QACpB,OAAO,EAAE,GAAG,IAAI,UAAU;QAC1B,WAAW,EAAE,GAAG,IAAI,OAAO;KAC5B,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,MAAM,EAAE,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;IAC9E,MAAM,GAAG,GAAG,KAAK,EAAE,IAAY,EAAqB,EAAE;QACpD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,CA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