@kensio/pinyinjs 1.7.10 → 1.7.12

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 (60) hide show
  1. package/README.md +2 -0
  2. package/data/full.entries +118 -118
  3. package/data/full.freq +0 -0
  4. package/data/manifest.json +4 -4
  5. package/data/standard.entries +111 -111
  6. package/dist/decode/de-rule.d.ts +4 -4
  7. package/dist/decode/de-rule.d.ts.map +1 -1
  8. package/dist/decode/de-rule.js +6 -16
  9. package/dist/decode/de-rule.js.map +1 -1
  10. package/dist/decode/edge-context.d.ts +14 -6
  11. package/dist/decode/edge-context.d.ts.map +1 -1
  12. package/dist/decode/edge-context.js +25 -0
  13. package/dist/decode/edge-context.js.map +1 -1
  14. package/dist/decode/reading-rules.d.ts +2 -0
  15. package/dist/decode/reading-rules.d.ts.map +1 -1
  16. package/dist/decode/reading-rules.js +6 -0
  17. package/dist/decode/reading-rules.js.map +1 -1
  18. package/dist/decode/rules.d.ts +1 -1
  19. package/dist/decode/rules.d.ts.map +1 -1
  20. package/dist/decode/rules.js +1 -1
  21. package/dist/decode/rules.js.map +1 -1
  22. package/dist/decode/split-rule.d.ts +43 -0
  23. package/dist/decode/split-rule.d.ts.map +1 -0
  24. package/dist/decode/split-rule.js +174 -0
  25. package/dist/decode/split-rule.js.map +1 -0
  26. package/dist/decode/taxi-rule.d.ts +45 -0
  27. package/dist/decode/taxi-rule.d.ts.map +1 -0
  28. package/dist/decode/taxi-rule.js +117 -0
  29. package/dist/decode/taxi-rule.js.map +1 -0
  30. package/dist/dictionary/dictionary.d.ts +14 -0
  31. package/dist/dictionary/dictionary.d.ts.map +1 -1
  32. package/dist/dictionary/dictionary.js +17 -0
  33. package/dist/dictionary/dictionary.js.map +1 -1
  34. package/dist/dictionary/entry-invariants.d.ts.map +1 -1
  35. package/dist/dictionary/entry-invariants.js +28 -0
  36. package/dist/dictionary/entry-invariants.js.map +1 -1
  37. package/dist/dictionary/proper-noun.d.ts.map +1 -1
  38. package/dist/dictionary/proper-noun.js +27 -3
  39. package/dist/dictionary/proper-noun.js.map +1 -1
  40. package/dist/dictionary/variant-counts.d.ts +4 -0
  41. package/dist/dictionary/variant-counts.d.ts.map +1 -1
  42. package/dist/dictionary/variant-counts.js +4 -0
  43. package/dist/dictionary/variant-counts.js.map +1 -1
  44. package/dist/index.d.ts +3 -2
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +3 -2
  47. package/dist/index.js.map +1 -1
  48. package/dist/search/candidate-query.d.ts +14 -0
  49. package/dist/search/candidate-query.d.ts.map +1 -1
  50. package/dist/search/candidate-query.js +23 -2
  51. package/dist/search/candidate-query.js.map +1 -1
  52. package/dist/search/reverse-index-format.d.ts +8 -0
  53. package/dist/search/reverse-index-format.d.ts.map +1 -1
  54. package/dist/search/reverse-index-format.js +8 -0
  55. package/dist/search/reverse-index-format.js.map +1 -1
  56. package/dist/sources/cedict.d.ts +15 -0
  57. package/dist/sources/cedict.d.ts.map +1 -1
  58. package/dist/sources/cedict.js +21 -0
  59. package/dist/sources/cedict.js.map +1 -1
  60. package/package.json +1 -1
@@ -60,10 +60,10 @@ export declare const POTENTIAL_DE: EdgeRule;
60
60
  * Only a key **no source has tagged** is forbidden, which is the same line
61
61
  * {@link TEACHING_JIAO} draws for a word ending in 教. 的确, 的士 and 的哥 are
62
62
  * words jieba counted and tagged, and every one of them can genuinely begin
63
- * where this fires: 我的确知道, 我要一辆的士, 那个的哥. That leaves 我的哥哥们
64
- * reading `wǒ dī gēgē men`, since 的哥 is a taxi driver and jieba has counted
65
- * them. What this does reach is the untagged tail — a reading somebody asserted
66
- * rather than a word anybody counted — where the 的 is the particle every time.
63
+ * where this fires: 我的确知道, 我要一辆的士, 那个的哥. What it does reach is
64
+ * the untagged tail — a reading somebody asserted rather than a word anybody
65
+ * counted — where the 的 is the particle every time. The tagged taxi keys are
66
+ * {@link import("./taxi-rule.js").TAXI_DI}'s, which is what settles 我的哥哥们.
67
67
  *
68
68
  * Measured over the 88,866 lines of Tatoeba and zh.wikipedia it forbids edges
69
69
  * in 40 runs: 的筆 13, 的這 11, 的真 6, 的對 4, 的卡 4 and 的歷 once. Every one
@@ -1 +1 @@
1
- {"version":3,"file":"de-rule.d.ts","sourceRoot":"","sources":["../../src/decode/de-rule.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,QAAQ,EAKd,MAAM,YAAY,CAAC;AAgCpB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,QAAQ,EAAE,QActB,CAAC;AAkDF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,YAAY,EAAE,QAoB1B,CAAC;AAWF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,WAAW,EAAE,QAczB,CAAC"}
1
+ {"version":3,"file":"de-rule.d.ts","sourceRoot":"","sources":["../../src/decode/de-rule.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,KAAK,QAAQ,EAKd,MAAM,YAAY,CAAC;AAgCpB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,QAAQ,EAAE,QActB,CAAC;AA8CF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,YAAY,EAAE,QAoB1B,CAAC;AAWF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,WAAW,EAAE,QAczB,CAAC"}
@@ -1,13 +1,4 @@
1
- /**
2
- * The two rules about 得 and 的, which are one character each and three jobs.
3
- *
4
- * 得 is stored as the structural particle with `dé` and `děi` as alternates,
5
- * and 的 is stored as the particle full stop. Both are among the commonest
6
- * characters in the language, so the words they begin and end are numerous and
7
- * mostly wrong.
8
- */
9
- import { toCharacters } from "../script/characters.js";
10
- import { tagOf, wordEndingAt, wordStartingAt, wordsStartingAt, } from "./rules.js";
1
+ import { startsLongerWord, tagOf, wordEndingAt, wordStartingAt, } from "./rules.js";
11
2
  /**
12
3
  * Whether a syllable is `děi`, the modal reading of 得.
13
4
  *
@@ -112,8 +103,7 @@ function isDe(syllable) {
112
103
  * own and a test that counted those would answer yes everywhere.
113
104
  */
114
105
  function isSwallowed(context, at) {
115
- const longer = (from) => wordsStartingAt(context, from).some((word) => toCharacters(word).length > 1);
116
- return longer(at) && !longer(at + 1);
106
+ return startsLongerWord(context, at) && !startsLongerWord(context, at + 1);
117
107
  }
118
108
  /**
119
109
  * A verb and a 得 in front of a complement is not a word reading `dé`.
@@ -173,10 +163,10 @@ const MODIFIED_TAGS = /^(?:r|n|a|v|b|z)/u;
173
163
  * Only a key **no source has tagged** is forbidden, which is the same line
174
164
  * {@link TEACHING_JIAO} draws for a word ending in 教. 的确, 的士 and 的哥 are
175
165
  * words jieba counted and tagged, and every one of them can genuinely begin
176
- * where this fires: 我的确知道, 我要一辆的士, 那个的哥. That leaves 我的哥哥们
177
- * reading `wǒ dī gēgē men`, since 的哥 is a taxi driver and jieba has counted
178
- * them. What this does reach is the untagged tail — a reading somebody asserted
179
- * rather than a word anybody counted — where the 的 is the particle every time.
166
+ * where this fires: 我的确知道, 我要一辆的士, 那个的哥. What it does reach is
167
+ * the untagged tail — a reading somebody asserted rather than a word anybody
168
+ * counted — where the 的 is the particle every time. The tagged taxi keys are
169
+ * {@link import("./taxi-rule.js").TAXI_DI}'s, which is what settles 我的哥哥们.
180
170
  *
181
171
  * Measured over the 88,866 lines of Tatoeba and zh.wikipedia it forbids edges
182
172
  * in 40 runs: 的筆 13, 的這 11, 的真 6, 的對 4, 的卡 4 and 的歷 once. Every one
@@ -1 +1 @@
1
- {"version":3,"file":"de-rule.js","sourceRoot":"","sources":["../../src/decode/de-rule.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAGL,KAAK,EACL,YAAY,EACZ,cAAc,EACd,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB;;;;;GAKG;AACH,SAAS,K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;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAa;IACnC,IAAI,EAAE,aAAa;IACnB,UAAU,EAAE,CAAC,OAAoB,EAAE,EAAE;QACnC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QACzB,IACE,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC;YACvB,IAAI,CAAC,YAAY,KAAK,EAAE;YACxB,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAC1B,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAChD,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;IACxE,CAAC;CACF,CAAC"}
@@ -1,9 +1,3 @@
1
- /**
2
- * What a rule can ask about the words around an edge.
3
- *
4
- * The lookups every edge rule shares: which word ends here, which starts here,
5
- * and what part of speech the dictionary gives it.
6
- */
7
1
  import type { EdgeContext } from "./rules.js";
8
2
  /**
9
3
  * The word ending at a position, longest first, or undefined.
@@ -41,6 +35,20 @@ export declare function wordsStartingAt(context: EdgeContext, at: number, longes
41
35
  * The part of speech the dictionary gives a word, or the empty string.
42
36
  */
43
37
  export declare function tagOf(context: EdgeContext, word: string | undefined): string;
38
+ /**
39
+ * Whether a word of more than one character starts at a position.
40
+ *
41
+ * Every character is a word of its own, so a test that counted those would
42
+ * answer yes everywhere. What a rule asking this wants to know is whether some
43
+ * longer word has a claim on the character.
44
+ */
45
+ export declare function startsLongerWord(context: EdgeContext, at: number): boolean;
46
+ /**
47
+ * Whether a word of more than one character ends at a position.
48
+ *
49
+ * The mirror of {@link startsLongerWord}, and asked for the same reason.
50
+ */
51
+ export declare function endsLongerWord(context: EdgeContext, at: number): boolean;
44
52
  /**
45
53
  * What follows a 教 that is teaching where no object does: aspect and the
46
54
  * complement marker, which only a verb takes.
@@ -1 +1 @@
1
- {"version":3,"file":"edge-context.d.ts","sourceRoot":"","sources":["../../src/decode/edge-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,MAAM,EACV,OAAO,SAAI,GACV,MAAM,GAAG,SAAS,CAYpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,MAAM,EACV,OAAO,SAAI,GACV,SAAS,MAAM,EAAE,CAanB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,MAAM,EACV,OAAO,SAAI,GACV,MAAM,GAAG,SAAS,CAUpB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,MAAM,EACV,OAAO,SAAI,GACV,SAAS,MAAM,EAAE,CASnB;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAI5E;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,aAA0C,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,YAAY,MAAM,CAAC"}
1
+ {"version":3,"file":"edge-context.d.ts","sourceRoot":"","sources":["../../src/decode/edge-context.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,MAAM,EACV,OAAO,SAAI,GACV,MAAM,GAAG,SAAS,CAYpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,MAAM,EACV,OAAO,SAAI,GACV,SAAS,MAAM,EAAE,CAanB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,MAAM,EACV,OAAO,SAAI,GACV,MAAM,GAAG,SAAS,CAUpB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,MAAM,EACV,OAAO,SAAI,GACV,SAAS,MAAM,EAAE,CASnB;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAI5E;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAI1E;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAIxE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,aAA0C,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,YAAY,MAAM,CAAC"}
@@ -1,3 +1,10 @@
1
+ /**
2
+ * What a rule can ask about the words around an edge.
3
+ *
4
+ * The lookups every edge rule shares: which word ends here, which starts here,
5
+ * and what part of speech the dictionary gives it.
6
+ */
7
+ import { toCharacters } from "../script/characters.js";
1
8
  /**
2
9
  * The word ending at a position, longest first, or undefined.
3
10
  *
@@ -82,6 +89,24 @@ export function tagOf(context, word) {
82
89
  ? ""
83
90
  : (context.dictionary.lookup(word)?.partOfSpeech ?? "");
84
91
  }
92
+ /**
93
+ * Whether a word of more than one character starts at a position.
94
+ *
95
+ * Every character is a word of its own, so a test that counted those would
96
+ * answer yes everywhere. What a rule asking this wants to know is whether some
97
+ * longer word has a claim on the character.
98
+ */
99
+ export function startsLongerWord(context, at) {
100
+ return wordsStartingAt(context, at).some((word) => toCharacters(word).length > 1);
101
+ }
102
+ /**
103
+ * Whether a word of more than one character ends at a position.
104
+ *
105
+ * The mirror of {@link startsLongerWord}, and asked for the same reason.
106
+ */
107
+ export function endsLongerWord(context, at) {
108
+ return wordsEndingAt(context, at).some((word) => toCharacters(word).length > 1);
109
+ }
85
110
  /**
86
111
  * What follows a 教 that is teaching where no object does: aspect and the
87
112
  * complement marker, which only a verb takes.
@@ -1 +1 @@
1
- {"version":3,"file":"edge-context.js","sourceRoot":"","sources":["../../src/decode/edge-context.ts"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,OAAoB,EACpB,EAAU,EACV,OAAO,GAAG,CAAC;IAEX,KAAK,IAAI,MAAM,GAAG,OAAO,EAAE,MAAM,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;QAChD,MAAM,IAAI,GAAG,EAAE,GAAG,MAAM,CAAC;QACzB,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;YACb,SAAS;QACX,CAAC;QACD,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzD,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;YAClD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAoB,EACpB,EAAU,EACV,OAAO,GAAG,CAAC;IAEX,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,KAAK,IAAI,MAAM,GAAG,OAAO,EAAE,MAAM,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,CAA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AC,OAAoB,EAAE,EAAU;IAC7D,OAAO,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,CACpC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CACxC,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAE9D;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC"}
@@ -1,6 +1,8 @@
1
1
  export { MODAL_DE, PARTICLE_DE, POTENTIAL_DE } from "./de-rule.js";
2
+ export { TAXI_DI } from "./taxi-rule.js";
2
3
  export { EXPERIENTIAL_GUO } from "./guo-rule.js";
3
4
  export { TEACHING_JIAO } from "./jiao-rule.js";
5
+ export { SEPARATED_COMPOUND } from "./split-rule.js";
4
6
  import { type EdgeRule } from "./rules.js";
5
7
  /**
6
8
  * 儿 does not stand on its own where the dictionary attests the 儿化.
@@ -1 +1 @@
1
- {"version":3,"file":"reading-rules.d.ts","sourceRoot":"","sources":["../../src/decode/reading-rules.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,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,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,QAAQ,EAU5C,CAAC"}
1
+ {"version":3,"file":"reading-rules.d.ts","sourceRoot":"","sources":["../../src/decode/reading-rules.ts"],"names":[],"mappings":"AAOA,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;AAErD,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,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,QAAQ,EAY5C,CAAC"}
@@ -1,10 +1,14 @@
1
1
  import { QUANTITY_CHARACTERS } from "../numerals/characters.js";
2
2
  import { MODAL_DE, PARTICLE_DE, POTENTIAL_DE } from "./de-rule.js";
3
+ import { TAXI_DI } from "./taxi-rule.js";
3
4
  import { EXPERIENTIAL_GUO } from "./guo-rule.js";
4
5
  import { TEACHING_JIAO } from "./jiao-rule.js";
6
+ import { SEPARATED_COMPOUND } from "./split-rule.js";
5
7
  export { MODAL_DE, PARTICLE_DE, POTENTIAL_DE } from "./de-rule.js";
8
+ export { TAXI_DI } from "./taxi-rule.js";
6
9
  export { EXPERIENTIAL_GUO } from "./guo-rule.js";
7
10
  export { TEACHING_JIAO } from "./jiao-rule.js";
11
+ export { SEPARATED_COMPOUND } from "./split-rule.js";
8
12
  import { toCharacters } from "../script/characters.js";
9
13
  import { tagOf, wordEndingAt, } from "./rules.js";
10
14
  /**
@@ -132,11 +136,13 @@ export const READING_RULES = [
132
136
  MODAL_DE,
133
137
  PARTICLE_DE,
134
138
  POTENTIAL_DE,
139
+ TAXI_DI,
135
140
  TEACHING_JIAO,
136
141
  ATTESTED_ERHUA,
137
142
  COUNTED_MEASURE,
138
143
  ADJECTIVAL_CHANG,
139
144
  PLAYING_TAN,
140
145
  EXPERIENTIAL_GUO,
146
+ SEPARATED_COMPOUND,
141
147
  ];
142
148
  //# 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,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAGL,KAAK,EACL,YAAY,GACb,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAa;IACtC,IAAI,EAAE,gBAAgB;IACtB,UAAU,EAAE,CAAC,OAAoB,EAAE,EAAE;QACnC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,G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iBAAiB;IACvB,UAAU,EAAE,CAAC,OAAoB,EAAE,EAAE;QACnC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QACrC,yEAAyE;QACzE,yEAAyE;QACzE,yEAAyE;QACzE,WAAW;QACX,IACE,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC;YACvB,IAAI,CAAC,OAAO,CAAC,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,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAErE;;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;CACnB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { Dictionary } from "../dictionary/dictionary.js";
2
2
  import type { Lattice, LatticeEdge } from "./lattice.js";
3
- export { ASPECT, PARTICLE_TAG, tagOf, wordEndingAt, wordsEndingAt, wordStartingAt, wordsStartingAt, } from "./edge-context.js";
3
+ export { ASPECT, endsLongerWord, PARTICLE_TAG, startsLongerWord, tagOf, wordEndingAt, wordsEndingAt, wordStartingAt, wordsStartingAt, } from "./edge-context.js";
4
4
  /**
5
5
  * What a rule can say about one edge.
6
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/decode/rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EACL,MAAM,EACN,YAAY,EACZ,KAAK,EACL,YAAY,EACZ,aAAa,EACb,cAAc,EACd,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,WAAW,CAAC;CAC5D;AA+DD;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,SAAS,QAAQ,EAAE,GACzB,OAAO,CAsCT"}
1
+ {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/decode/rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EACL,MAAM,EACN,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,aAAa,EACb,cAAc,EACd,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,WAAW,CAAC;CAC5D;AA+DD;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,SAAS,QAAQ,EAAE,GACzB,OAAO,CAsCT"}
@@ -1,4 +1,4 @@
1
- export { ASPECT, PARTICLE_TAG, tagOf, wordEndingAt, wordsEndingAt, wordStartingAt, wordsStartingAt, } from "./edge-context.js";
1
+ export { ASPECT, endsLongerWord, PARTICLE_TAG, startsLongerWord, tagOf, wordEndingAt, wordsEndingAt, wordStartingAt, wordsStartingAt, } from "./edge-context.js";
2
2
  /**
3
3
  * Whether every position can still be left, and the end still reached.
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/decode/rules.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,MAAM,EACN,YAAY,EACZ,KAAK,EACL,YAAY,EACZ,aAAa,EACb,cAAc,EACd,eAAe,GAChB,MAAM,mBAAmB,CA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is `qǐngjià` and 请个假 came out `qǐng gè jiǎ`, because the word the
6
+ * reading hangs on is no longer there to be matched and each half falls back on
7
+ * its character's default. 睡个觉 went to `jué`, 弹个琴 to `dàn`, 教个书 to
8
+ * `jiào` and 有个空 to `kōng`, all of them the reading the compound exists to
9
+ * rule out. Nothing here is new about the characters. The dictionary already
10
+ * holds `jià` as an alternate of 假 and already states that 请假 is `qǐng jià`.
11
+ * What was missing is that the second fact reaches the first across a 个.
12
+ *
13
+ * A 离合词 is a verb and its object written as one word, so the halves come
14
+ * apart and take an infix between them the way no other compound does. The
15
+ * classifier is the commonest infix, and that is what makes the shape
16
+ * decidable. See {@link separatedSyllableAt} for the three conditions and
17
+ * {@link CLASSIFIER} for why no other 量词 is in.
18
+ *
19
+ * Both halves are settled, because either can be the polyphone. 请个假 and
20
+ * 睡个觉 misread the tail, 弹个琴 and 教个书 the head.
21
+ *
22
+ * Measured over the same 88,866 lines of Tatoeba and zh.wikipedia the other
23
+ * rules were sized against, 2,018 head-个-tail shapes have a dictionary pair
24
+ * behind them. The conditions admit 3 and all 3 are corrections (请个假 to
25
+ * `jià`, 打个折 to `zhé` and 睡個覺 to `jiào`). The 66 they decline are pairs the
26
+ * index happens to hold (两个都 off 两都, 一个和 off 一和, 那个是 off 那是,
27
+ * 一个只 off 一只), where no word was ever split in two, and the verb-head
28
+ * condition alone accounts for 44 of them.
29
+ *
30
+ * The one real firing given up is 瞅个空 for `kòng`, which 瞅空 would carry if
31
+ * an untagged pair were allowed to. It goes with 是个甚, and that trade is the
32
+ * right way round, since the corpus has one of each and admitting untagged
33
+ * pairs opens the rule to 720,000 keys nobody counted.
34
+ *
35
+ * The measurement is thin because the shape is rare in written text, so the
36
+ * conditions were sized against the dictionary as well. 2,994 tagged pairs with
37
+ * a verb in front hold a half whose reading differs from its character's
38
+ * default, and they are led by 认为, 获得, 关系 and 告诉, none of which any 个
39
+ * can be pushed into. The rule never reaches them, since it fires on a 个 that
40
+ * is written rather than on a pair that exists.
41
+ */
42
+ export declare const SEPARATED_COMPOUND: EdgeRule;
43
+ //# sourceMappingURL=split-rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split-rule.d.ts","sourceRoot":"","sources":["../../src/decode/split-rule.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,KAAK,QAAQ,EAGd,MAAM,YAAY,CAAC;AA+HpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAehC,CAAC"}
@@ -0,0 +1,174 @@
1
+ /**
2
+ * How a 离合词 is read once a 量词 has been pushed into the middle of it.
3
+ *
4
+ * 请假 is one word and carries one reading. 请个假 is the same word with a
5
+ * classifier inside it, and the halves are left standing on their own.
6
+ */
7
+ import { isSameSyllable } from "../dictionary/entry.js";
8
+ import { toCharacters } from "../script/characters.js";
9
+ import { tagOf, wordsStartingAt, } from "./rules.js";
10
+ /**
11
+ * The classifier that separates the halves, in both scripts.
12
+ *
13
+ * 个 alone, and the measurement below is the reason. Every other 量词 was tried
14
+ * and the noise buried the signal. The dictionary tags 道, 名, 家, 子, 口 and 集
15
+ * `q` too, and those spend almost all of their time as ordinary morphemes, so
16
+ * 知道了 read its 了 as `liǎo` off 知了 and 有道理 its 理 as `lǐ` off 有理.
17
+ * Widening to the whole `q` tag carries the rule from 3 firings to 109, of
18
+ * which 46 are that one 知道了.
19
+ *
20
+ * 下 and 回 are outside it for a different reason. Both separate a compound
21
+ * readily enough, but both also head a directional complement, and 坐下来,
22
+ * 拿回来 and 生下来 all end in a 来 that is neutral where the compound behind
23
+ * them says `lái`. Adding the pair costs 34 wrong firings to gain none.
24
+ */
25
+ const CLASSIFIER = new Set(["个", "個"]);
26
+ /**
27
+ * The tag prefix jieba gives a verb.
28
+ *
29
+ * A prefix, so that `vn` and `vd` are in. 有空 is tagged `vn`.
30
+ */
31
+ const VERB_TAG = "v";
32
+ /**
33
+ * The two halves a classifier separates at a position, or undefined.
34
+ *
35
+ * The position is one half of the pair and the classifier says which. A 个 in
36
+ * front of it makes it the tail, and a 个 behind it makes it the head. Both are
37
+ * wanted, because either half can be the polyphone. 请个假 misreads the 假 and
38
+ * 弹个琴 the 弹.
39
+ */
40
+ function separatedAt(context, at) {
41
+ const { characters } = context;
42
+ if (CLASSIFIER.has(characters[at + 1] ?? "") && at + 2 < characters.length) {
43
+ return {
44
+ /* c8 ignore next -- both positions are inside the run just measured */
45
+ word: `${characters[at] ?? ""}${characters[at + 2] ?? ""}`,
46
+ offset: 0,
47
+ };
48
+ }
49
+ if (CLASSIFIER.has(characters[at - 1] ?? "") && at >= 2) {
50
+ return {
51
+ /* c8 ignore next -- both positions are inside the run just measured */
52
+ word: `${characters[at - 2] ?? ""}${characters[at] ?? ""}`,
53
+ offset: 1,
54
+ };
55
+ }
56
+ return undefined;
57
+ }
58
+ /**
59
+ * Whether a tagged word of more than one character starts at a position.
60
+ *
61
+ * The guard that keeps the rule off a 个 that is counting the word after it.
62
+ * 我看见那儿有个奇怪的女人 has 有奇 behind it, a key meaning *and a fraction
63
+ * more*, and forcing its `jī` onto a 奇 that opens 奇怪 is the one wrong firing
64
+ * the corpus offers. A tag is asked for and not merely a key, because the full
65
+ * tier holds 720,000 of them and 打个折么 finds 折么 that way. The tag is the
66
+ * record that somebody counted the word.
67
+ */
68
+ function opensTaggedWord(context, at) {
69
+ return wordsStartingAt(context, at).some((word) => toCharacters(word).length > 1 && tagOf(context, word) !== "");
70
+ }
71
+ /**
72
+ * The syllable a separated compound gives one of its halves, or undefined.
73
+ *
74
+ * Three things have to hold, and each one is carrying its weight over the
75
+ * corpus. The pair has to be a word the dictionary tags, since an untagged key
76
+ * is a reading somebody recorded rather than a word anybody counted, and
77
+ * 是个甚么 finds 是甚 that way and would read its 甚 as `shèn`. The character in
78
+ * front has to be a verb. That is what separates 请个假 from 一个只, 两个都 and
79
+ * 八个行, where the 个 counts the numeral in front of it and the pair behind is
80
+ * an accident. And the far half has to stand clear of a tagged word of its own,
81
+ * for the reason {@link opensTaggedWord} gives.
82
+ */
83
+ function separatedSyllableAt(context, at) {
84
+ const separated = separatedAt(context, at);
85
+ if (separated === undefined) {
86
+ return undefined;
87
+ }
88
+ const { word, offset } = separated;
89
+ const entry = context.dictionary.lookup(word);
90
+ if (entry?.reading.length !== 2 || entry.partOfSpeech === "") {
91
+ return undefined;
92
+ }
93
+ const [head = ""] = toCharacters(word);
94
+ if (!tagOf(context, head).startsWith(VERB_TAG)) {
95
+ return undefined;
96
+ }
97
+ const tail = offset === 1 ? at : at + 2;
98
+ return opensTaggedWord(context, tail) ? undefined : entry.reading[offset];
99
+ }
100
+ /**
101
+ * Whether a pair the dictionary holds carries the unseparated reading across.
102
+ *
103
+ * Forcing the single-character edge settles nothing on its own, for the reason
104
+ * {@link TEACHING_JIAO} gives. A reading spanning two characters brings its own
105
+ * half with it. 能给我打个折么 read `shémǒ` off 折么, a key the dictionary holds
106
+ * with no part of speech and at the cost of a word nothing has ever counted.
107
+ * A *tagged* word is left alone, which is every one that matters.
108
+ */
109
+ function carriesReading(context, edge) {
110
+ if (edge.partOfSpeech !== "" || edge.reading.length !== edge.to - edge.from) {
111
+ return false;
112
+ }
113
+ return edge.reading.some((syllable, offset) => {
114
+ const said = separatedSyllableAt(context, edge.from + offset);
115
+ return said !== undefined && !isSameSyllable(syllable, said);
116
+ });
117
+ }
118
+ /**
119
+ * A 离合词 keeps its reading when a 量词 is pushed into the middle of it.
120
+ *
121
+ * 请假 is `qǐngjià` and 请个假 came out `qǐng gè jiǎ`, because the word the
122
+ * reading hangs on is no longer there to be matched and each half falls back on
123
+ * its character's default. 睡个觉 went to `jué`, 弹个琴 to `dàn`, 教个书 to
124
+ * `jiào` and 有个空 to `kōng`, all of them the reading the compound exists to
125
+ * rule out. Nothing here is new about the characters. The dictionary already
126
+ * holds `jià` as an alternate of 假 and already states that 请假 is `qǐng jià`.
127
+ * What was missing is that the second fact reaches the first across a 个.
128
+ *
129
+ * A 离合词 is a verb and its object written as one word, so the halves come
130
+ * apart and take an infix between them the way no other compound does. The
131
+ * classifier is the commonest infix, and that is what makes the shape
132
+ * decidable. See {@link separatedSyllableAt} for the three conditions and
133
+ * {@link CLASSIFIER} for why no other 量词 is in.
134
+ *
135
+ * Both halves are settled, because either can be the polyphone. 请个假 and
136
+ * 睡个觉 misread the tail, 弹个琴 and 教个书 the head.
137
+ *
138
+ * Measured over the same 88,866 lines of Tatoeba and zh.wikipedia the other
139
+ * rules were sized against, 2,018 head-个-tail shapes have a dictionary pair
140
+ * behind them. The conditions admit 3 and all 3 are corrections (请个假 to
141
+ * `jià`, 打个折 to `zhé` and 睡個覺 to `jiào`). The 66 they decline are pairs the
142
+ * index happens to hold (两个都 off 两都, 一个和 off 一和, 那个是 off 那是,
143
+ * 一个只 off 一只), where no word was ever split in two, and the verb-head
144
+ * condition alone accounts for 44 of them.
145
+ *
146
+ * The one real firing given up is 瞅个空 for `kòng`, which 瞅空 would carry if
147
+ * an untagged pair were allowed to. It goes with 是个甚, and that trade is the
148
+ * right way round, since the corpus has one of each and admitting untagged
149
+ * pairs opens the rule to 720,000 keys nobody counted.
150
+ *
151
+ * The measurement is thin because the shape is rare in written text, so the
152
+ * conditions were sized against the dictionary as well. 2,994 tagged pairs with
153
+ * a verb in front hold a half whose reading differs from its character's
154
+ * default, and they are led by 认为, 获得, 关系 and 告诉, none of which any 个
155
+ * can be pushed into. The rule never reaches them, since it fires on a 个 that
156
+ * is written rather than on a pair that exists.
157
+ */
158
+ export const SEPARATED_COMPOUND = {
159
+ name: "separated-compound",
160
+ verdictFor: (context) => {
161
+ const { edge } = context;
162
+ if (edge.to - edge.from !== 1 || edge.reading.length !== 1) {
163
+ return carriesReading(context, edge) ? "forbid" : "keep";
164
+ }
165
+ const said = separatedSyllableAt(context, edge.from);
166
+ const here = edge.reading[0];
167
+ /* c8 ignore next -- a one-syllable reading has a syllable at zero */
168
+ if (said === undefined || here === undefined) {
169
+ return "keep";
170
+ }
171
+ return isSameSyllable(here, said) ? "force" : "keep";
172
+ },
173
+ };
174
+ //# sourceMappingURL=split-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split-rule.js","sourceRoot":"","sources":["../../src/decode/split-rule.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAGL,KAAK,EACL,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAEvC;;;;GAIG;AACH,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB;;;;;;;GAOG;AACH,SAAS,WAAW,CAClB,OAAoB,EACpB,EAAU;IAEV,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAC/B,IAAI,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC;QAC3E,OAAO;YACL,uEAAuE;YACvE,IAAI,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,UAAU,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAC1D,MAAM,EAAE,CAAC;SACV,CAAC;IACJ,CAAC;IACD,IAAI,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;QACxD,OAAO;YACL,uEAAuE;YACvE,IAAI,EAAE,GAAG,UAAU,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE;YAC1D,MAAM,EAAE,CAAC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E,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,45 @@
1
+ import { type EdgeRule } from "./rules.js";
2
+ /**
3
+ * 的 read `dī` where the taxi word holding it stands, and written whole there.
4
+ *
5
+ * The taxi vocabulary is six keys (的士, 的哥, 的姐, 打的, 面的 and 摩的). The
6
+ * `dī` in them is the only `dī` the dictionary holds, and that reading names
7
+ * the set. All six also spell a modifier, a particle 的 and a head, much the
8
+ * commoner reading of the same characters, and the decode had it both ways at
9
+ * once. 我的哥哥们 came out `wǒ dī gēgē men` on the strength of 的哥, while
10
+ * 的士 came out `dī shì` on the strength of nothing at all.
11
+ *
12
+ * What decides it is what follows the 的, and where the key sits around the 的
13
+ * decides which question that is.
14
+ *
15
+ * A key **beginning** with the 的 offers its own second character as the head.
16
+ * A longer word starting there is the better claim on it. 哥哥 takes the 哥 of
17
+ * 我的哥哥们, 姐姐 the 姐 of 我的姐姐 and 士兵 the 士 of 我的士兵. Nothing
18
+ * starts at the 哥 of 那个的哥 or the 士 of 我要一辆的士, and both keys stand.
19
+ *
20
+ * A key **ending** with the 的 puts the head outside itself, and
21
+ * {@link AFTER_PARTICLE} is what one looks like. The other side is asked as
22
+ * well. A longer word ending at the 的 owns the character in front of it, and
23
+ * that is what 上面的, 方面的 and 表面的 are. Without that test 26 more runs of
24
+ * the corpus change and every one of them is wrong.
25
+ *
26
+ * Where the word does stand the bare 的 is taken out from under it. That is the
27
+ * spacing half of the same claim. 的 sits in the cheapest band the dictionary
28
+ * holds, at 5.62 against a 4.62 floor. A two-character key spanning one is
29
+ * therefore weighed against a split starting several buckets ahead of an
30
+ * ordinary word's, and 的士 came apart at 16.62 against 16.24 for the split
31
+ * where 的哥 at 14.62 held. Forbidding the split is what reaches spacing at
32
+ * all, since forcing an edge only settles the rivals covering the same
33
+ * characters.
34
+ *
35
+ * Measured over the 88,866 lines of Tatoeba and zh.wikipedia, 21 的 read `dī`
36
+ * and 9 of them were the particle. This changes 17 runs. Six are readings it
37
+ * corrects (所打的仗, 谁打的电话, 打的不是很好, 我的哥哥们, 我打的这辆出租车,
38
+ * 见过面的那个人), ten are taxi words that were split and now hold together,
39
+ * and the last is 用一元硬币来打的, which joins up while staying wrong. That
40
+ * one closes a 是⋯的 whose 是 sits in the clause before it, and no local
41
+ * evidence says so. The two others left are the 的哥里 of a transliterated
42
+ * Gori. The gold corpus holds at 3 misses and CPP at 91.49%.
43
+ */
44
+ export declare const TAXI_DI: EdgeRule;
45
+ //# sourceMappingURL=taxi-rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taxi-rule.d.ts","sourceRoot":"","sources":["../../src/decode/taxi-rule.ts"],"names":[],"mappings":"AAQA,OAAO,EAEL,KAAK,QAAQ,EAKd,MAAM,YAAY,CAAC;AA2EpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,OAAO,EAAE,QAYrB,CAAC"}