@kensio/pinyinjs 1.9.0 → 1.9.1

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 (111) hide show
  1. package/dist/decode/chang-context.d.ts +4 -0
  2. package/dist/decode/chang-context.d.ts.map +1 -1
  3. package/dist/decode/chang-context.js +16 -2
  4. package/dist/decode/chang-context.js.map +1 -1
  5. package/dist/decode/chang-rule.d.ts.map +1 -1
  6. package/dist/decode/chang-rule.js +6 -0
  7. package/dist/decode/chang-rule.js.map +1 -1
  8. package/dist/decode/chang-span.d.ts +37 -0
  9. package/dist/decode/chang-span.d.ts.map +1 -0
  10. package/dist/decode/chang-span.js +100 -0
  11. package/dist/decode/chang-span.js.map +1 -0
  12. package/dist/decode/chong-frames.d.ts +9 -0
  13. package/dist/decode/chong-frames.d.ts.map +1 -0
  14. package/dist/decode/chong-frames.js +58 -0
  15. package/dist/decode/chong-frames.js.map +1 -0
  16. package/dist/decode/ding-frames.d.ts +8 -0
  17. package/dist/decode/ding-frames.d.ts.map +1 -0
  18. package/dist/decode/ding-frames.js +54 -0
  19. package/dist/decode/ding-frames.js.map +1 -0
  20. package/dist/decode/dominant-readings.d.ts +55 -0
  21. package/dist/decode/dominant-readings.d.ts.map +1 -0
  22. package/dist/decode/dominant-readings.js +67 -0
  23. package/dist/decode/dominant-readings.js.map +1 -0
  24. package/dist/decode/dominant-rule.d.ts +24 -0
  25. package/dist/decode/dominant-rule.d.ts.map +1 -0
  26. package/dist/decode/dominant-rule.js +122 -0
  27. package/dist/decode/dominant-rule.js.map +1 -0
  28. package/dist/decode/guo-rule.d.ts.map +1 -1
  29. package/dist/decode/guo-rule.js +12 -0
  30. package/dist/decode/guo-rule.js.map +1 -1
  31. package/dist/decode/hao-rule.d.ts +16 -0
  32. package/dist/decode/hao-rule.d.ts.map +1 -0
  33. package/dist/decode/hao-rule.js +61 -0
  34. package/dist/decode/hao-rule.js.map +1 -0
  35. package/dist/decode/ji-frames.d.ts +9 -0
  36. package/dist/decode/ji-frames.d.ts.map +1 -0
  37. package/dist/decode/ji-frames.js +71 -0
  38. package/dist/decode/ji-frames.js.map +1 -0
  39. package/dist/decode/jiao-rule.d.ts +5 -6
  40. package/dist/decode/jiao-rule.d.ts.map +1 -1
  41. package/dist/decode/jiao-rule.js +39 -3
  42. package/dist/decode/jiao-rule.js.map +1 -1
  43. package/dist/decode/jie-frames.d.ts +6 -0
  44. package/dist/decode/jie-frames.d.ts.map +1 -0
  45. package/dist/decode/jie-frames.js +94 -0
  46. package/dist/decode/jie-frames.js.map +1 -0
  47. package/dist/decode/liang-frames.d.ts +6 -0
  48. package/dist/decode/liang-frames.d.ts.map +1 -0
  49. package/dist/decode/liang-frames.js +112 -0
  50. package/dist/decode/liang-frames.js.map +1 -0
  51. package/dist/decode/polyphone-rules.d.ts +2 -1
  52. package/dist/decode/polyphone-rules.d.ts.map +1 -1
  53. package/dist/decode/polyphone-rules.js +2 -1
  54. package/dist/decode/polyphone-rules.js.map +1 -1
  55. package/dist/decode/reading-rules.d.ts +3 -1
  56. package/dist/decode/reading-rules.d.ts.map +1 -1
  57. package/dist/decode/reading-rules.js +9 -2
  58. package/dist/decode/reading-rules.js.map +1 -1
  59. package/dist/decode/reduplication-readings.d.ts +26 -0
  60. package/dist/decode/reduplication-readings.d.ts.map +1 -0
  61. package/dist/decode/reduplication-readings.js +48 -0
  62. package/dist/decode/reduplication-readings.js.map +1 -0
  63. package/dist/decode/reduplication-rule.d.ts +1 -1
  64. package/dist/decode/reduplication-rule.d.ts.map +1 -1
  65. package/dist/decode/reduplication-rule.js +2 -41
  66. package/dist/decode/reduplication-rule.js.map +1 -1
  67. package/dist/decode/shu-frames.d.ts +6 -0
  68. package/dist/decode/shu-frames.d.ts.map +1 -0
  69. package/dist/decode/shu-frames.js +102 -0
  70. package/dist/decode/shu-frames.js.map +1 -0
  71. package/dist/decode/split-infix.d.ts +25 -0
  72. package/dist/decode/split-infix.d.ts.map +1 -0
  73. package/dist/decode/split-infix.js +134 -0
  74. package/dist/decode/split-infix.js.map +1 -0
  75. package/dist/decode/split-rule.d.ts +11 -0
  76. package/dist/decode/split-rule.d.ts.map +1 -1
  77. package/dist/decode/split-rule.js +17 -4
  78. package/dist/decode/split-rule.js.map +1 -1
  79. package/dist/decode/tiao-frames.d.ts +6 -0
  80. package/dist/decode/tiao-frames.d.ts.map +1 -0
  81. package/dist/decode/tiao-frames.js +60 -0
  82. package/dist/decode/tiao-frames.js.map +1 -0
  83. package/dist/decode/verbal-frame.d.ts +68 -0
  84. package/dist/decode/verbal-frame.d.ts.map +1 -0
  85. package/dist/decode/verbal-frame.js +76 -0
  86. package/dist/decode/verbal-frame.js.map +1 -0
  87. package/dist/decode/verbal-held.d.ts +12 -0
  88. package/dist/decode/verbal-held.d.ts.map +1 -0
  89. package/dist/decode/verbal-held.js +63 -0
  90. package/dist/decode/verbal-held.js.map +1 -0
  91. package/dist/decode/verbal-rule.d.ts +31 -0
  92. package/dist/decode/verbal-rule.d.ts.map +1 -0
  93. package/dist/decode/verbal-rule.js +100 -0
  94. package/dist/decode/verbal-rule.js.map +1 -0
  95. package/dist/decode/xiang-frames.d.ts +6 -0
  96. package/dist/decode/xiang-frames.d.ts.map +1 -0
  97. package/dist/decode/xiang-frames.js +65 -0
  98. package/dist/decode/xiang-frames.js.map +1 -0
  99. package/dist/decode/zhuan-frames.d.ts +6 -0
  100. package/dist/decode/zhuan-frames.d.ts.map +1 -0
  101. package/dist/decode/zhuan-frames.js +97 -0
  102. package/dist/decode/zhuan-frames.js.map +1 -0
  103. package/dist/dictionary/frequency-table.d.ts +8 -0
  104. package/dist/dictionary/frequency-table.d.ts.map +1 -1
  105. package/dist/dictionary/frequency-table.js +11 -1
  106. package/dist/dictionary/frequency-table.js.map +1 -1
  107. package/dist/index.d.ts +1 -1
  108. package/dist/index.d.ts.map +1 -1
  109. package/dist/index.js +1 -1
  110. package/dist/index.js.map +1 -1
  111. package/package.json +1 -1
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Whether a 量 is measuring something or is an amount.
3
+ *
4
+ * The verb is `liáng` and the noun `liàng`. The noun stands on its own mostly
5
+ * as the tail of a compound the dictionary lacks: 乘客量, 排放量, 信息量. The
6
+ * verb has someone doing the measuring in front of it and the thing measured,
7
+ * or 了 or 一下, after it.
8
+ */
9
+ import { tagOf, wordEndingAt, wordStartingAt, } from "./rules.js";
10
+ import { isBareAt, startsWithAny, syllableOf, charactersOf, } from "./verbal-frame.js";
11
+ /**
12
+ * What a measuring 量 takes straight after it: aspect, or how often.
13
+ *
14
+ * 量了我的体温, 量一下门的宽度, 我每六小时量一次体温. 量过 is left out, because
15
+ * 需求量过大 is "the demand is too great".
16
+ */
17
+ const ASPECT = new Set(["了", "着"]);
18
+ /**
19
+ * How many times, which only a verb is followed by.
20
+ */
21
+ const TIMES = ["一下", "一次", "一遍"];
22
+ /**
23
+ * What is measured: the body's readings and a thing's dimensions.
24
+ *
25
+ * 量体温, 量血压, 量门的宽度. The 的 of the last is what this cannot see past,
26
+ * so the word has to stand straight after the 量.
27
+ */
28
+ const MEASURED = [
29
+ "体温",
30
+ "血压",
31
+ "身高",
32
+ "体重",
33
+ "脉搏",
34
+ "尺寸",
35
+ "长度",
36
+ "宽度",
37
+ "高度",
38
+ "厚度",
39
+ "深度",
40
+ "直径",
41
+ "腰围",
42
+ "胸围",
43
+ "距离",
44
+ "面积",
45
+ "温度",
46
+ ];
47
+ /**
48
+ * What can come straight before a 量 that is measuring.
49
+ *
50
+ * Asking someone to (请, 帮), being in the middle of it (正在), and the modals
51
+ * (要, 会, 可以). None of these makes a compound with 量. 能 does, which is
52
+ * why it is out.
53
+ */
54
+ const BEFORE = new Set([
55
+ "请",
56
+ "帮",
57
+ "给",
58
+ "正在",
59
+ "再",
60
+ "先",
61
+ "要",
62
+ "会",
63
+ "可以",
64
+ ]);
65
+ /**
66
+ * The tag prefix jieba gives a noun.
67
+ */
68
+ const NOUN_TAG = "n";
69
+ /**
70
+ * Whether the 量 at a position is measuring.
71
+ *
72
+ * Where nothing after it says so, the word in front of it has to, and
73
+ * something measurable has to follow: 正在量病人的脉搏.
74
+ */
75
+ function isMeasuringAt(context, at) {
76
+ const { characters } = context;
77
+ if (isBareAt(context, at + 1, ASPECT) ||
78
+ startsWithAny(context, at + 1, TIMES) ||
79
+ startsWithAny(context, at + 1, MEASURED) ||
80
+ characters[at + 1] === "量" ||
81
+ characters[at - 1] === "量") {
82
+ return true;
83
+ }
84
+ const before = wordEndingAt(context, at);
85
+ return (before !== undefined &&
86
+ BEFORE.has(before) &&
87
+ tagOf(context, wordStartingAt(context, at + 1)).startsWith(NOUN_TAG));
88
+ }
89
+ /**
90
+ * The characters that bind it into a compound reading it otherwise.
91
+ *
92
+ * Bound before it: 打量, 商量, 能量, 测量, 考量 and the rest of the compounds
93
+ * reading it `liàng` or as the tail of a verb of their own. Bound after it:
94
+ * 量力, 量产, 量子, 量词. 能 is a modal as well, and 你能量一下吗 is lost to
95
+ * 能量, which is the commoner by far.
96
+ */
97
+ const BOUND_BEFORE = charactersOf("打商思估掂酌衡丈测測考能力质質数數重容含流产產销銷雨剂劑胆膽热熱音尽盡大少适適总總增计計度用储儲存变變等限降雪电電光当當");
98
+ /**
99
+ * The characters after it that bind it into such a compound.
100
+ */
101
+ const BOUND_AFTER = charactersOf("力产產子词詞刑化级級表程变變");
102
+ /**
103
+ * 量 read `liáng` where it is measuring.
104
+ */
105
+ export const LIANG_FRAME = {
106
+ characters: new Set(["量"]),
107
+ reading: syllableOf("liáng"),
108
+ boundBefore: BOUND_BEFORE,
109
+ boundAfter: BOUND_AFTER,
110
+ isVerbalAt: isMeasuringAt,
111
+ };
112
+ //# sourceMappingURL=liang-frames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liang-frames.js","sourceRoot":"","sources":["../../src/decode/liang-frames.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAEL,KAAK,EACL,YAAY,EACZ,cAAc,GACf,MAAM,YAAY,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MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACzC,OAAO,CACL,MAAM,KAAK,SAAS;QACpB,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;QAClB,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CACrE,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,YAAY,GAAG,YAAY,CAC/B,8DAA8D,CAC/D,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,UAAU,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAC1B,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;IAC5B,WAAW,EAAE,YAAY;IACzB,UAAU,EAAE,WAAW;IACvB,UAAU,EAAE,aAAa;CAC1B,CAAC"}
@@ -3,9 +3,10 @@
3
3
  *
4
4
  * 弹 is `tán` or `dàn`, and which one a text means is a question about the
5
5
  * neighbours rather than about the character. 长 is the same question and has
6
- * a file of its own. The other rules in `reading-rules.ts` are about particles
6
+ * a file of its own, and 好学 is the same question asked of a word. The other rules in `reading-rules.ts` are about particles
7
7
  * and 儿化, which is a different kind of evidence.
8
8
  */
9
9
  export { ADJECTIVAL_CHANG } from "./chang-rule.js";
10
10
  export { PLAYING_TAN } from "./tan-rule.js";
11
+ export { EASY_HAO } from "./hao-rule.js";
11
12
  //# sourceMappingURL=polyphone-rules.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"polyphone-rules.d.ts","sourceRoot":"","sources":["../../src/decode/polyphone-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"polyphone-rules.d.ts","sourceRoot":"","sources":["../../src/decode/polyphone-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
@@ -3,9 +3,10 @@
3
3
  *
4
4
  * 弹 is `tán` or `dàn`, and which one a text means is a question about the
5
5
  * neighbours rather than about the character. 长 is the same question and has
6
- * a file of its own. The other rules in `reading-rules.ts` are about particles
6
+ * a file of its own, and 好学 is the same question asked of a word. The other rules in `reading-rules.ts` are about particles
7
7
  * and 儿化, which is a different kind of evidence.
8
8
  */
9
9
  export { ADJECTIVAL_CHANG } from "./chang-rule.js";
10
10
  export { PLAYING_TAN } from "./tan-rule.js";
11
+ export { EASY_HAO } from "./hao-rule.js";
11
12
  //# sourceMappingURL=polyphone-rules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"polyphone-rules.js","sourceRoot":"","sources":["../../src/decode/polyphone-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"polyphone-rules.js","sourceRoot":"","sources":["../../src/decode/polyphone-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
@@ -2,6 +2,7 @@ export { MODAL_DE, PARTICLE_DE, POTENTIAL_DE } from "./de-rule.js";
2
2
  export { TAXI_DI } from "./taxi-rule.js";
3
3
  export { EXPERIENTIAL_GUO } from "./guo-rule.js";
4
4
  export { TEACHING_JIAO } from "./jiao-rule.js";
5
+ export { DOMINANT_READING } from "./dominant-rule.js";
5
6
  export { SEPARATED_COMPOUND } from "./split-rule.js";
6
7
  export { RETURNING_HUAN } from "./huan-rule.js";
7
8
  export { CONCERNING_GAN } from "./gan-rule.js";
@@ -9,6 +10,7 @@ export { COUNTING_ZHI } from "./zhi-rule.js";
9
10
  export { POTENTIAL_LIAO } from "./liao-rule.js";
10
11
  export { OBTAINING_DE } from "./obtain-rule.js";
11
12
  export { REDUPLICATED_VERB } from "./reduplication-rule.js";
13
+ export { VERBAL_READING } from "./verbal-rule.js";
12
14
  import { type EdgeRule } from "./rules.js";
13
15
  /**
14
16
  * 儿 does not stand on its own where the dictionary attests the 儿化.
@@ -60,7 +62,7 @@ export declare const ATTESTED_ERHUA: EdgeRule;
60
62
  * corpus and it is a fix, 下了两天雨 having read 天雨 as `tiān yù`.
61
63
  */
62
64
  export declare const COUNTED_MEASURE: EdgeRule;
63
- export { ADJECTIVAL_CHANG, PLAYING_TAN } from "./polyphone-rules.js";
65
+ export { ADJECTIVAL_CHANG, EASY_HAO, PLAYING_TAN } from "./polyphone-rules.js";
64
66
  /**
65
67
  * The rules the lattice decode applies, in order.
66
68
  */
@@ -1 +1 @@
1
- {"version":3,"file":"reading-rules.d.ts","sourceRoot":"","sources":["../../src/decode/reading-rules.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EA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Y,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAEL,KAAK,QAAQ,EAGd,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,cAAc,EAAE,QAY5B,CAAC;AAsCF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,eAAe,EAAE,QAuB7B,CAAC;AAIF,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,QAAQ,EAqB5C,CAAC"}
@@ -3,6 +3,7 @@ import { MODAL_DE, PARTICLE_DE, POTENTIAL_DE } from "./de-rule.js";
3
3
  import { TAXI_DI } from "./taxi-rule.js";
4
4
  import { EXPERIENTIAL_GUO } from "./guo-rule.js";
5
5
  import { TEACHING_JIAO } from "./jiao-rule.js";
6
+ import { DOMINANT_READING } from "./dominant-rule.js";
6
7
  import { SEPARATED_COMPOUND } from "./split-rule.js";
7
8
  import { RETURNING_HUAN } from "./huan-rule.js";
8
9
  import { CONCERNING_GAN } from "./gan-rule.js";
@@ -10,10 +11,12 @@ import { COUNTING_ZHI } from "./zhi-rule.js";
10
11
  import { POTENTIAL_LIAO } from "./liao-rule.js";
11
12
  import { OBTAINING_DE } from "./obtain-rule.js";
12
13
  import { REDUPLICATED_VERB } from "./reduplication-rule.js";
14
+ import { VERBAL_READING } from "./verbal-rule.js";
13
15
  export { MODAL_DE, PARTICLE_DE, POTENTIAL_DE } from "./de-rule.js";
14
16
  export { TAXI_DI } from "./taxi-rule.js";
15
17
  export { EXPERIENTIAL_GUO } from "./guo-rule.js";
16
18
  export { TEACHING_JIAO } from "./jiao-rule.js";
19
+ export { DOMINANT_READING } from "./dominant-rule.js";
17
20
  export { SEPARATED_COMPOUND } from "./split-rule.js";
18
21
  export { RETURNING_HUAN } from "./huan-rule.js";
19
22
  export { CONCERNING_GAN } from "./gan-rule.js";
@@ -21,6 +24,7 @@ export { COUNTING_ZHI } from "./zhi-rule.js";
21
24
  export { POTENTIAL_LIAO } from "./liao-rule.js";
22
25
  export { OBTAINING_DE } from "./obtain-rule.js";
23
26
  export { REDUPLICATED_VERB } from "./reduplication-rule.js";
27
+ export { VERBAL_READING } from "./verbal-rule.js";
24
28
  import { toCharacters } from "../script/characters.js";
25
29
  import { tagOf, wordEndingAt, } from "./rules.js";
26
30
  /**
@@ -139,8 +143,8 @@ export const COUNTED_MEASURE = {
139
143
  : "keep";
140
144
  },
141
145
  };
142
- import { ADJECTIVAL_CHANG, PLAYING_TAN } from "./polyphone-rules.js";
143
- export { ADJECTIVAL_CHANG, PLAYING_TAN } from "./polyphone-rules.js";
146
+ import { ADJECTIVAL_CHANG, EASY_HAO, PLAYING_TAN } from "./polyphone-rules.js";
147
+ export { ADJECTIVAL_CHANG, EASY_HAO, PLAYING_TAN } from "./polyphone-rules.js";
144
148
  /**
145
149
  * The rules the lattice decode applies, in order.
146
150
  */
@@ -162,5 +166,8 @@ export const READING_RULES = [
162
166
  COUNTING_ZHI,
163
167
  POTENTIAL_LIAO,
164
168
  OBTAINING_DE,
169
+ VERBAL_READING,
170
+ DOMINANT_READING,
171
+ EASY_HAO,
165
172
  ];
166
173
  //# sourceMappingURL=reading-rules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reading-rules.js","sourceRoot":"","sources":["../../src/decode/reading-rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAA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,MAAM,KAAK,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,EAC3C,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,OAAO;YACtD,IAAI,CAAC,YAAY,KAAK,OAAO;YAC7B,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,MAAM,CAAC;IACb,CAAC;CACF,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAwB;IAChD,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,OAAO;IACP,aAAa;IACb,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,WAAW;IACX,gBAAgB;IAChB,kBAAkB;IAClB,iBAAiB;IACjB,cAAc;IACd,cAAc;IACd,YAAY;IACZ,cAAc;IACd,YAAY;IACZ,cAAc;IACd,gBAAgB;IAChB,QAAQ;CACT,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The verbs the reduplication rule reads, and the reading each takes.
3
+ */
4
+ import { type Syllable } from "../syllable/syllable.js";
5
+ /**
6
+ * The polyphones whose verbal reading is not their default.
7
+ *
8
+ * The default is the reading a character takes in most text. For these that
9
+ * reading is a noun (数 `shù`, 种 `zhǒng`, 量 `liàng`), an adjective (凉
10
+ * `liáng`), another verb (转 `zhuǎn`, which changes where `zhuàn` spins) or the
11
+ * reading their compounds take (教 `jiào`, 弹 `dàn`, 削 `xuē`). A
12
+ * reduplicated character is a verb, and the verbal reading is the one it
13
+ * wants.
14
+ *
15
+ * 卷 is in for its tail. Its default is already `juǎn`, and 卷一卷 read the
16
+ * second half `juàn` off 一卷, a word the dictionary tags `m`.
17
+ *
18
+ * Written out by hand because the dictionary has no tag per reading. The
19
+ * nearest thing it holds is the reduplicated word itself, and that is the
20
+ * wrong evidence. Of the 19 AA keys in the standard tier whose first syllable
21
+ * differs from the character's default, 数数 (in both scripts) is the only
22
+ * verb said twice. The rest are literary reduplicatives (查查 `zhāzhā`, 拜拜 `báibái`, 累累
23
+ * `léiléi`), and reading 查一查 off 查查 would turn a correct `chá` into `zhā`.
24
+ */
25
+ export declare const VERBAL_READINGS: ReadonlyMap<string, Syllable>;
26
+ //# sourceMappingURL=reduplication-readings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reduplication-readings.d.ts","sourceRoot":"","sources":["../../src/decode/reduplication-readings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CA0BzD,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * The verbs the reduplication rule reads, and the reading each takes.
3
+ */
4
+ import { readSyllable } from "../syllable/syllable.js";
5
+ /**
6
+ * The polyphones whose verbal reading is not their default.
7
+ *
8
+ * The default is the reading a character takes in most text. For these that
9
+ * reading is a noun (数 `shù`, 种 `zhǒng`, 量 `liàng`), an adjective (凉
10
+ * `liáng`), another verb (转 `zhuǎn`, which changes where `zhuàn` spins) or the
11
+ * reading their compounds take (教 `jiào`, 弹 `dàn`, 削 `xuē`). A
12
+ * reduplicated character is a verb, and the verbal reading is the one it
13
+ * wants.
14
+ *
15
+ * 卷 is in for its tail. Its default is already `juǎn`, and 卷一卷 read the
16
+ * second half `juàn` off 一卷, a word the dictionary tags `m`.
17
+ *
18
+ * Written out by hand because the dictionary has no tag per reading. The
19
+ * nearest thing it holds is the reduplicated word itself, and that is the
20
+ * wrong evidence. Of the 19 AA keys in the standard tier whose first syllable
21
+ * differs from the character's default, 数数 (in both scripts) is the only
22
+ * verb said twice. The rest are literary reduplicatives (查查 `zhāzhā`, 拜拜 `báibái`, 累累
23
+ * `léiléi`), and reading 查一查 off 查查 would turn a correct `chá` into `zhā`.
24
+ */
25
+ export const VERBAL_READINGS = new Map([
26
+ ["数", "shǔ"],
27
+ ["數", "shǔ"],
28
+ ["凉", "liàng"],
29
+ ["涼", "liàng"],
30
+ ["种", "zhòng"],
31
+ ["種", "zhòng"],
32
+ ["教", "jiāo"],
33
+ ["弹", "tán"],
34
+ ["彈", "tán"],
35
+ ["卷", "juǎn"],
36
+ ["削", "xiāo"],
37
+ ["量", "liáng"],
38
+ ["转", "zhuàn"],
39
+ ["轉", "zhuàn"],
40
+ ].map(([character, text]) => {
41
+ const syllable = readSyllable(text);
42
+ /* c8 ignore next 3 -- every reading above is a syllable */
43
+ if (syllable === undefined) {
44
+ throw new Error(`${text} is not a syllable`);
45
+ }
46
+ return [character, syllable];
47
+ }));
48
+ //# sourceMappingURL=reduplication-readings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reduplication-readings.js","sourceRoot":"","sources":["../../src/decode/reduplication-readings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAiB,MAAM,yBAAyB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAkC,IAAI,GAAG,CAEjE;IACE,CAAC,GAAG,EAAE,KAAK,CAAC;IACZ,CAAC,GAAG,EAAE,KAAK,CAAC;IACZ,CAAC,GAAG,EAAE,OAAO,CAAC;IACd,CAAC,GAAG,EAAE,OAAO,CAAC;IACd,CAAC,GAAG,EAAE,OAAO,CAAC;IACd,CAAC,GAAG,EAAE,OAAO,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,KAAK,CAAC;IACZ,CAAC,GAAG,EAAE,KAAK,CAAC;IACZ,CAAC,GAAG,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,OAAO,CAAC;IACd,CAAC,GAAG,EAAE,OAAO,CAAC;IACd,CAAC,GAAG,EAAE,OAAO,CAAC;CAEjB,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE;IAC1B,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACpC,2DAA2D;IAC3D,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,oBAAoB,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC/B,CAAC,CAAC,CACH,CAAC"}
@@ -10,7 +10,7 @@ import { type EdgeRule } from "./rules.js";
10
10
  * The same shape split other verbs down the middle. 弹了弹 read `tán le dàn`,
11
11
  * because the 弹 rule saw the 了 after the first half and nothing after the
12
12
  * second. 教了教 read `jiāo le jiào` for the same reason. See
13
- * {@link VERBAL_READINGS} for the characters and {@link reduplicatedAt} for
13
+ * {@link import("./reduplication-readings.js").VERBAL_READINGS} for the characters and {@link reduplicatedAt} for
14
14
  * the shapes turned away.
15
15
  *
16
16
  * Over 88,866 lines of Tatoeba and zh.wikipedia, A了A and A一A appear 107
@@ -1 +1 @@
1
- {"version":3,"file":"reduplication-rule.d.ts","sourceRoot":"","sources":["../../src/decode/reduplication-rule.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,QAAQ,EAId,MAAM,YAAY,CAAC;AAqIpB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAc/B,CAAC"}
1
+ {"version":3,"file":"reduplication-rule.d.ts","sourceRoot":"","sources":["../../src/decode/reduplication-rule.ts"],"names":[],"mappings":"AAWA,OAAO,EAEL,KAAK,QAAQ,EAId,MAAM,YAAY,CAAC;AAyFpB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAc/B,CAAC"}
@@ -7,7 +7,7 @@
7
7
  import { isSameSyllable } from "../dictionary/entry.js";
8
8
  import { QUANTITY_CHARACTERS } from "../numerals/characters.js";
9
9
  import { toCharacters } from "../script/characters.js";
10
- import { readSyllable } from "../syllable/syllable.js";
10
+ import { VERBAL_READINGS } from "./reduplication-readings.js";
11
11
  import { tagOf, wordsEndingAt, wordsStartingAt, } from "./rules.js";
12
12
  /**
13
13
  * What can stand between the halves of a reduplicated verb.
@@ -17,45 +17,6 @@ import { tagOf, wordsEndingAt, wordsStartingAt, } from "./rules.js";
17
17
  * {@link reduplicatedAt} turns that shape away by the numeral in front.
18
18
  */
19
19
  const INFIX = new Set(["了", "一"]);
20
- /**
21
- * The polyphones whose verbal reading is not their default.
22
- *
23
- * The default is the reading a character takes in most text. For these that
24
- * reading is a noun (数 `shù`, 种 `zhǒng`), an adjective (凉 `liáng`) or the
25
- * reading their compounds take (教 `jiào`, 弹 `dàn`, 削 `xuē`). A
26
- * reduplicated character is a verb, and the verbal reading is the one it
27
- * wants.
28
- *
29
- * 卷 is in for its tail. Its default is already `juǎn`, and 卷一卷 read the
30
- * second half `juàn` off 一卷, a word the dictionary tags `m`.
31
- *
32
- * Written out by hand because the dictionary has no tag per reading. The
33
- * nearest thing it holds is the reduplicated word itself, and that is the
34
- * wrong evidence. Of the 19 AA keys in the standard tier whose first syllable
35
- * differs from the character's default, 数数 (in both scripts) is the only
36
- * verb said twice. The rest are literary reduplicatives (查查 `zhāzhā`, 拜拜 `báibái`, 累累
37
- * `léiléi`), and reading 查一查 off 查查 would turn a correct `chá` into `zhā`.
38
- */
39
- const VERBAL_READINGS = new Map([
40
- ["数", "shǔ"],
41
- ["數", "shǔ"],
42
- ["凉", "liàng"],
43
- ["涼", "liàng"],
44
- ["种", "zhòng"],
45
- ["種", "zhòng"],
46
- ["教", "jiāo"],
47
- ["弹", "tán"],
48
- ["彈", "tán"],
49
- ["卷", "juǎn"],
50
- ["削", "xiāo"],
51
- ].map(([character, text]) => {
52
- const syllable = readSyllable(text);
53
- /* c8 ignore next 3 -- every reading above is a syllable */
54
- if (syllable === undefined) {
55
- throw new Error(`${text} is not a syllable`);
56
- }
57
- return [character, syllable];
58
- }));
59
20
  /**
60
21
  * Whether a tagged word of more than one character starts or ends at a
61
22
  * position.
@@ -130,7 +91,7 @@ function readsAgainst(context) {
130
91
  * The same shape split other verbs down the middle. 弹了弹 read `tán le dàn`,
131
92
  * because the 弹 rule saw the 了 after the first half and nothing after the
132
93
  * second. 教了教 read `jiāo le jiào` for the same reason. See
133
- * {@link VERBAL_READINGS} for the characters and {@link reduplicatedAt} for
94
+ * {@link import("./reduplication-readings.js").VERBAL_READINGS} for the characters and {@link reduplicatedAt} for
134
95
  * the shapes turned away.
135
96
  *
136
97
  * Over 88,866 lines of Tatoeba and zh.wikipedia, A了A and A一A appear 107
@@ -1 +1 @@
1
- {"version":3,"file":"reduplication-rule.js","sourceRoot":"","sources":["../../src/decode/reduplication-rule.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAiB,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAGL,KAAK,EACL,aAAa,EACb,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAElC;;;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AC3D,OAAO,IAAI,KAAK,SAAS,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAa;IACzC,IAAI,EAAE,mBAAmB;IACzB,UAAU,EAAE,CAAC,OAAoB,EAAE,EAAE;QACnC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QACzB,IAAI,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAC9B,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;QACnD,CAAC;QACD,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAClD,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YAC7C,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IACvD,CAAC;CACF,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { type VerbalFrame } from "./verbal-frame.js";
2
+ /**
3
+ * 数 read `shǔ` where it is counting.
4
+ */
5
+ export declare const SHU_FRAME: VerbalFrame;
6
+ //# sourceMappingURL=shu-frames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shu-frames.d.ts","sourceRoot":"","sources":["../../src/decode/shu-frames.ts"],"names":[],"mappings":"AAeA,OAAO,EAKL,KAAK,WAAW,EAEjB,MAAM,mBAAmB,CAAC;AAiG3B;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,WAMvB,CAAC"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Whether a 数 is counting or is a number.
3
+ *
4
+ * The verb is `shǔ` and the noun `shù`. A 数 standing on its own is most often
5
+ * "several" in front of a number or a measure word (数十人, 数千人, 数个小时),
6
+ * or the tail of a compound the dictionary lacks (里程数, 网民数). The verb
7
+ * counts up to something, or takes 了 or 一下.
8
+ */
9
+ import { QUANTITY_CHARACTERS } from "../numerals/characters.js";
10
+ import { tagOf, wordEndingAt, wordStartingAt, } from "./rules.js";
11
+ import { isBareAt, isRunEnd, startsWithAny, syllableOf, charactersOf, } from "./verbal-frame.js";
12
+ /**
13
+ * The 到 of 数到十, which only counting is followed by.
14
+ */
15
+ const UP_TO = new Set(["到"]);
16
+ /**
17
+ * Aspect after the verb: 我数了一下, 汤姆数了他的钱, 你有试过数星星吗.
18
+ */
19
+ const ASPECT = new Set(["了", "着", "过", "過"]);
20
+ /**
21
+ * How many times, which only a verb is followed by.
22
+ */
23
+ const TIMES = ["一下", "一遍", "一数"];
24
+ /**
25
+ * What can come straight before a 数 that is counting.
26
+ *
27
+ * 开始数羊, 这孩子能数到二十. 在 is left out, since 在数分钟内 is "within a few
28
+ * minutes".
29
+ */
30
+ const BEFORE = new Set(["开始", "会", "能", "可以", "请", "再", "一起", "帮"]);
31
+ /**
32
+ * The tags of what a counting 数 can be followed by after {@link BEFORE}.
33
+ *
34
+ * Nouns of every kind and pronouns. The spans of time in {@link TIME} are
35
+ * nouns too, and are kept out before the tag is asked.
36
+ */
37
+ function isCountedTag(tag) {
38
+ return tag.startsWith("n") || tag === "r";
39
+ }
40
+ /**
41
+ * The spans of time 数 counts as "several": 数小时, 数日, 数年.
42
+ */
43
+ const TIME = [
44
+ "小时",
45
+ "年",
46
+ "天",
47
+ "日",
48
+ "月",
49
+ "周",
50
+ "星期",
51
+ "世纪",
52
+ "分钟",
53
+ "秒",
54
+ ];
55
+ /**
56
+ * Whether the 数 at a position is counting.
57
+ *
58
+ * A numeral in front of it makes it part of a number, as in 十数人.
59
+ */
60
+ function isCountingAt(context, at) {
61
+ const { characters } = context;
62
+ if (QUANTITY_CHARACTERS.has(characters[at - 1] ?? "")) {
63
+ return false;
64
+ }
65
+ if (isBareAt(context, at + 1, UP_TO) ||
66
+ startsWithAny(context, at + 1, TIMES) ||
67
+ isBareAt(context, at + 1, ASPECT)) {
68
+ return true;
69
+ }
70
+ const before = wordEndingAt(context, at);
71
+ if (before === undefined || !BEFORE.has(before)) {
72
+ return false;
73
+ }
74
+ if (isRunEnd(context, at + 1)) {
75
+ return true;
76
+ }
77
+ return (!startsWithAny(context, at + 1, TIME) &&
78
+ isCountedTag(tagOf(context, wordStartingAt(context, at + 1))));
79
+ }
80
+ /**
81
+ * The characters that bind it into a compound reading it otherwise.
82
+ *
83
+ * Bound before it: 岁数, 多数, 人数, 次数, 分数 and the other nouns ending in
84
+ * it, so 你多大岁数了 is not read as counting. 倒数 is left out, since it
85
+ * counts too.
86
+ */
87
+ const BOUND_BEFORE = charactersOf("岁歲多少人次倍分无無函指常变變参參级級总總页頁字步票件户戶名头頭号號礼禮算整基奇偶正负負复複小半单單双雙实實虚虛质質素回场場");
88
+ /**
89
+ * The characters after it that bind it into such a compound.
90
+ */
91
+ const BOUND_AFTER = new Set();
92
+ /**
93
+ * 数 read `shǔ` where it is counting.
94
+ */
95
+ export const SHU_FRAME = {
96
+ characters: new Set(["数", "數"]),
97
+ reading: syllableOf("shǔ"),
98
+ boundBefore: BOUND_BEFORE,
99
+ boundAfter: BOUND_AFTER,
100
+ isVerbalAt: isCountingAt,
101
+ };
102
+ //# sourceMappingURL=shu-frames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shu-frames.js","sourceRoot":"","sources":["../../src/decode/shu-frames.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAEL,KAAK,EACL,YAAY,EACZ,cAAc,GACf,MAAM,YAAY,CAA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E,KAAK,CAAC;QACrC,QAAQ,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,EACjC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACzC,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC;QACrC,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAC9D,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,YAAY,GAAG,YAAY,CAC/B,gEAAgE,CACjE,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,GAAwB,IAAI,GAAG,EAAE,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAgB;IACpC,UAAU,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC/B,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC;IAC1B,WAAW,EAAE,YAAY;IACzB,UAAU,EAAE,WAAW;IACvB,UAAU,EAAE,YAAY;CACzB,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { Syllable } from "../syllable/syllable.js";
2
+ import { type EdgeContext } from "./rules.js";
3
+ /**
4
+ * The syllable a 离合词 separated by more than a 个 gives its tail, or
5
+ * undefined.
6
+ *
7
+ * The nearest head the {@link INFIX} pattern reaches is the one asked about,
8
+ * so 我还没睡够觉 finds 睡觉 and never gets as far as the 还. The pair has to
9
+ * be tagged a verb itself, which is what a 离合词 is, and 打了场硬仗 found the
10
+ * 打场 of threshing, a noun, behind a 场 that was counting. That stands in for
11
+ * the 个 shape's verb in front, which the dictionary leaves untagged on 休, 流
12
+ * and 理, so 休一天假, 流了血 and 理了发 are read through it. The tail has to be
13
+ * an object, for the reason {@link isObject} gives, and must not run on into a
14
+ * noun, for the reason {@link modifiesWhatFollows} gives.
15
+ *
16
+ * The 个 shape's `opensTaggedWord` is left out, because it changed
17
+ * nothing over either corpus. Forcing the tail's own edge leaves a longer word
18
+ * starting at it to the decode, so 我睡了觉得好多了 still reads 觉得 whole.
19
+ *
20
+ * Only the tail is settled. A head reached across a complement can be an
21
+ * adverb the tags call a verb, and 还不够钱 would read its 还 as `huán` off
22
+ * 还钱.
23
+ */
24
+ export declare function widelySeparatedSyllableAt(context: EdgeContext, at: number): Syllable | undefined;
25
+ //# sourceMappingURL=split-infix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split-infix.d.ts","sourceRoot":"","sources":["../../src/decode/split-infix.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,KAAK,WAAW,EAAS,MAAM,YAAY,CAAC;AAoGrD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,MAAM,GACT,QAAQ,GAAG,SAAS,CAmBtB"}