@kensio/pinyinjs 1.7.4 → 1.7.5

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 (695) hide show
  1. package/dist/accuracy/score-case.d.ts +23 -0
  2. package/dist/accuracy/score-case.d.ts.map +1 -0
  3. package/dist/accuracy/score-case.js +63 -0
  4. package/dist/accuracy/score-case.js.map +1 -0
  5. package/dist/accuracy/score.d.ts +1 -8
  6. package/dist/accuracy/score.d.ts.map +1 -1
  7. package/dist/accuracy/score.js +1 -55
  8. package/dist/accuracy/score.js.map +1 -1
  9. package/dist/cli/arguments.d.ts +4 -290
  10. package/dist/cli/arguments.d.ts.map +1 -1
  11. package/dist/cli/arguments.js +5 -357
  12. package/dist/cli/arguments.js.map +1 -1
  13. package/dist/cli/check-command.d.ts +9 -0
  14. package/dist/cli/check-command.d.ts.map +1 -0
  15. package/dist/cli/check-command.js +95 -0
  16. package/dist/cli/check-command.js.map +1 -0
  17. package/dist/cli/cli-input.d.ts +49 -0
  18. package/dist/cli/cli-input.d.ts.map +1 -0
  19. package/dist/cli/cli-input.js +31 -0
  20. package/dist/cli/cli-input.js.map +1 -0
  21. package/dist/cli/command.d.ts +97 -0
  22. package/dist/cli/command.d.ts.map +1 -0
  23. package/dist/cli/command.js +40 -0
  24. package/dist/cli/command.js.map +1 -0
  25. package/dist/cli/commands.d.ts +7 -110
  26. package/dist/cli/commands.d.ts.map +1 -1
  27. package/dist/cli/commands.js +14 -991
  28. package/dist/cli/commands.js.map +1 -1
  29. package/dist/cli/convert-command.d.ts +6 -0
  30. package/dist/cli/convert-command.d.ts.map +1 -0
  31. package/dist/cli/convert-command.js +52 -0
  32. package/dist/cli/convert-command.js.map +1 -0
  33. package/dist/cli/environment.d.ts +1 -1
  34. package/dist/cli/environment.d.ts.map +1 -1
  35. package/dist/cli/explain-command.d.ts +6 -0
  36. package/dist/cli/explain-command.d.ts.map +1 -0
  37. package/dist/cli/explain-command.js +40 -0
  38. package/dist/cli/explain-command.js.map +1 -0
  39. package/dist/cli/explain-syllable.d.ts +10 -0
  40. package/dist/cli/explain-syllable.d.ts.map +1 -0
  41. package/dist/cli/explain-syllable.js +70 -0
  42. package/dist/cli/explain-syllable.js.map +1 -0
  43. package/dist/cli/flag-help.d.ts +18 -0
  44. package/dist/cli/flag-help.d.ts.map +1 -0
  45. package/dist/cli/flag-help.js +78 -0
  46. package/dist/cli/flag-help.js.map +1 -0
  47. package/dist/cli/flag-lists.d.ts +49 -0
  48. package/dist/cli/flag-lists.d.ts.map +1 -0
  49. package/dist/cli/flag-lists.js +58 -0
  50. package/dist/cli/flag-lists.js.map +1 -0
  51. package/dist/cli/flag-values.d.ts +44 -0
  52. package/dist/cli/flag-values.d.ts.map +1 -0
  53. package/dist/cli/flag-values.js +56 -0
  54. package/dist/cli/flag-values.js.map +1 -0
  55. package/dist/cli/flags.d.ts +193 -0
  56. package/dist/cli/flags.d.ts.map +1 -0
  57. package/dist/cli/flags.js +133 -0
  58. package/dist/cli/flags.js.map +1 -0
  59. package/dist/cli/format-options.d.ts +29 -0
  60. package/dist/cli/format-options.d.ts.map +1 -0
  61. package/dist/cli/format-options.js +72 -0
  62. package/dist/cli/format-options.js.map +1 -0
  63. package/dist/cli/global-help.d.ts +23 -0
  64. package/dist/cli/global-help.d.ts.map +1 -0
  65. package/dist/cli/global-help.js +40 -0
  66. package/dist/cli/global-help.js.map +1 -0
  67. package/dist/cli/help.d.ts +1 -1
  68. package/dist/cli/help.d.ts.map +1 -1
  69. package/dist/cli/help.js +5 -99
  70. package/dist/cli/help.js.map +1 -1
  71. package/dist/cli/html-commands.d.ts +13 -0
  72. package/dist/cli/html-commands.d.ts.map +1 -0
  73. package/dist/cli/html-commands.js +49 -0
  74. package/dist/cli/html-commands.js.map +1 -0
  75. package/dist/cli/info-command.d.ts +7 -0
  76. package/dist/cli/info-command.d.ts.map +1 -0
  77. package/dist/cli/info-command.js +39 -0
  78. package/dist/cli/info-command.js.map +1 -0
  79. package/dist/cli/lookup-commands.d.ts +10 -0
  80. package/dist/cli/lookup-commands.d.ts.map +1 -0
  81. package/dist/cli/lookup-commands.js +101 -0
  82. package/dist/cli/lookup-commands.js.map +1 -0
  83. package/dist/cli/match-command.d.ts +11 -0
  84. package/dist/cli/match-command.d.ts.map +1 -0
  85. package/dist/cli/match-command.js +76 -0
  86. package/dist/cli/match-command.js.map +1 -0
  87. package/dist/cli/number-command.d.ts +12 -0
  88. package/dist/cli/number-command.d.ts.map +1 -0
  89. package/dist/cli/number-command.js +89 -0
  90. package/dist/cli/number-command.js.map +1 -0
  91. package/dist/cli/options.d.ts +30 -0
  92. package/dist/cli/options.d.ts.map +1 -0
  93. package/dist/cli/options.js +54 -0
  94. package/dist/cli/options.js.map +1 -0
  95. package/dist/cli/run-command.d.ts +24 -0
  96. package/dist/cli/run-command.d.ts.map +1 -0
  97. package/dist/cli/run-command.js +40 -0
  98. package/dist/cli/run-command.js.map +1 -0
  99. package/dist/cli/run.d.ts +4 -42
  100. package/dist/cli/run.d.ts.map +1 -1
  101. package/dist/cli/run.js +6 -61
  102. package/dist/cli/run.js.map +1 -1
  103. package/dist/cli/script-command.d.ts +10 -0
  104. package/dist/cli/script-command.d.ts.map +1 -0
  105. package/dist/cli/script-command.js +58 -0
  106. package/dist/cli/script-command.js.map +1 -0
  107. package/dist/cli/segment-command.d.ts +11 -0
  108. package/dist/cli/segment-command.d.ts.map +1 -0
  109. package/dist/cli/segment-command.js +53 -0
  110. package/dist/cli/segment-command.js.map +1 -0
  111. package/dist/cli/slug-command.d.ts +10 -0
  112. package/dist/cli/slug-command.d.ts.map +1 -0
  113. package/dist/cli/slug-command.js +28 -0
  114. package/dist/cli/slug-command.js.map +1 -0
  115. package/dist/cli/syllable-command.d.ts +14 -0
  116. package/dist/cli/syllable-command.d.ts.map +1 -0
  117. package/dist/cli/syllable-command.js +82 -0
  118. package/dist/cli/syllable-command.js.map +1 -0
  119. package/dist/cli/system-table.d.ts +12 -0
  120. package/dist/cli/system-table.d.ts.map +1 -0
  121. package/dist/cli/system-table.js +48 -0
  122. package/dist/cli/system-table.js.map +1 -0
  123. package/dist/cli/systems.d.ts +57 -0
  124. package/dist/cli/systems.d.ts.map +1 -0
  125. package/dist/cli/systems.js +27 -0
  126. package/dist/cli/systems.js.map +1 -0
  127. package/dist/cli/transcribe-command.d.ts +18 -0
  128. package/dist/cli/transcribe-command.d.ts.map +1 -0
  129. package/dist/cli/transcribe-command.js +86 -0
  130. package/dist/cli/transcribe-command.js.map +1 -0
  131. package/dist/cli/transcribe-reading.d.ts +15 -0
  132. package/dist/cli/transcribe-reading.d.ts.map +1 -0
  133. package/dist/cli/transcribe-reading.js +90 -0
  134. package/dist/cli/transcribe-reading.js.map +1 -0
  135. package/dist/cli/transcribe-rows.d.ts +26 -0
  136. package/dist/cli/transcribe-rows.d.ts.map +1 -0
  137. package/dist/cli/transcribe-rows.js +30 -0
  138. package/dist/cli/transcribe-rows.js.map +1 -0
  139. package/dist/cli/usage-error.d.ts +9 -0
  140. package/dist/cli/usage-error.d.ts.map +1 -0
  141. package/dist/cli/usage-error.js +9 -0
  142. package/dist/cli/usage-error.js.map +1 -0
  143. package/dist/decode/alternatives.d.ts +16 -0
  144. package/dist/decode/alternatives.d.ts.map +1 -0
  145. package/dist/decode/alternatives.js +31 -0
  146. package/dist/decode/alternatives.js.map +1 -0
  147. package/dist/decode/confidence.d.ts.map +1 -1
  148. package/dist/decode/confidence.js +3 -118
  149. package/dist/decode/confidence.js.map +1 -1
  150. package/dist/decode/convert-options.d.ts +116 -0
  151. package/dist/decode/convert-options.d.ts.map +1 -0
  152. package/dist/decode/convert-options.js +2 -0
  153. package/dist/decode/convert-options.js.map +1 -0
  154. package/dist/decode/convert-pipeline.d.ts +18 -0
  155. package/dist/decode/convert-pipeline.d.ts.map +1 -0
  156. package/dist/decode/convert-pipeline.js +66 -0
  157. package/dist/decode/convert-pipeline.js.map +1 -0
  158. package/dist/decode/convert.d.ts +9 -118
  159. package/dist/decode/convert.d.ts.map +1 -1
  160. package/dist/decode/convert.js +5 -453
  161. package/dist/decode/convert.js.map +1 -1
  162. package/dist/decode/decode.d.ts +2 -15
  163. package/dist/decode/decode.d.ts.map +1 -1
  164. package/dist/decode/decode.js +2 -121
  165. package/dist/decode/decode.js.map +1 -1
  166. package/dist/decode/decoders.d.ts +32 -0
  167. package/dist/decode/decoders.d.ts.map +1 -0
  168. package/dist/decode/decoders.js +29 -0
  169. package/dist/decode/decoders.js.map +1 -0
  170. package/dist/decode/edge-context.d.ts +38 -0
  171. package/dist/decode/edge-context.d.ts.map +1 -0
  172. package/dist/decode/edge-context.js +57 -0
  173. package/dist/decode/edge-context.js.map +1 -0
  174. package/dist/decode/hint-lattice.d.ts +45 -0
  175. package/dist/decode/hint-lattice.d.ts.map +1 -0
  176. package/dist/decode/hint-lattice.js +140 -0
  177. package/dist/decode/hint-lattice.js.map +1 -0
  178. package/dist/decode/hints.d.ts +2 -45
  179. package/dist/decode/hints.d.ts.map +1 -1
  180. package/dist/decode/hints.js +1 -139
  181. package/dist/decode/hints.js.map +1 -1
  182. package/dist/decode/jiao-rule.d.ts +58 -0
  183. package/dist/decode/jiao-rule.d.ts.map +1 -0
  184. package/dist/decode/jiao-rule.js +76 -0
  185. package/dist/decode/jiao-rule.js.map +1 -0
  186. package/dist/decode/lattice-costs.d.ts +55 -0
  187. package/dist/decode/lattice-costs.d.ts.map +1 -0
  188. package/dist/decode/lattice-costs.js +90 -0
  189. package/dist/decode/lattice-costs.js.map +1 -0
  190. package/dist/decode/lattice-edges.d.ts +29 -0
  191. package/dist/decode/lattice-edges.d.ts.map +1 -0
  192. package/dist/decode/lattice-edges.js +78 -0
  193. package/dist/decode/lattice-edges.js.map +1 -0
  194. package/dist/decode/lattice-slice.d.ts +37 -0
  195. package/dist/decode/lattice-slice.d.ts.map +1 -0
  196. package/dist/decode/lattice-slice.js +43 -0
  197. package/dist/decode/lattice-slice.js.map +1 -0
  198. package/dist/decode/lattice-types.d.ts +82 -0
  199. package/dist/decode/lattice-types.d.ts.map +1 -0
  200. package/dist/decode/lattice-types.js +44 -0
  201. package/dist/decode/lattice-types.js.map +1 -0
  202. package/dist/decode/lattice.d.ts +2 -59
  203. package/dist/decode/lattice.d.ts.map +1 -1
  204. package/dist/decode/lattice.js +2 -118
  205. package/dist/decode/lattice.js.map +1 -1
  206. package/dist/decode/number-pieces.d.ts +62 -0
  207. package/dist/decode/number-pieces.d.ts.map +1 -0
  208. package/dist/decode/number-pieces.js +106 -0
  209. package/dist/decode/number-pieces.js.map +1 -0
  210. package/dist/decode/numbers.d.ts +53 -0
  211. package/dist/decode/numbers.d.ts.map +1 -0
  212. package/dist/decode/numbers.js +69 -0
  213. package/dist/decode/numbers.js.map +1 -0
  214. package/dist/decode/pieces.d.ts +78 -0
  215. package/dist/decode/pieces.d.ts.map +1 -0
  216. package/dist/decode/pieces.js +136 -0
  217. package/dist/decode/pieces.js.map +1 -0
  218. package/dist/decode/polyphone-rules.d.ts +31 -0
  219. package/dist/decode/polyphone-rules.d.ts.map +1 -0
  220. package/dist/decode/polyphone-rules.js +159 -0
  221. package/dist/decode/polyphone-rules.js.map +1 -0
  222. package/dist/decode/reading-rules.d.ts +2 -97
  223. package/dist/decode/reading-rules.d.ts.map +1 -1
  224. package/dist/decode/reading-rules.js +4 -365
  225. package/dist/decode/reading-rules.js.map +1 -1
  226. package/dist/decode/rules.d.ts +1 -17
  227. package/dist/decode/rules.d.ts.map +1 -1
  228. package/dist/decode/rules.js +1 -43
  229. package/dist/decode/rules.js.map +1 -1
  230. package/dist/decode/run-lattice.d.ts +52 -0
  231. package/dist/decode/run-lattice.d.ts.map +1 -0
  232. package/dist/decode/run-lattice.js +91 -0
  233. package/dist/decode/run-lattice.js.map +1 -0
  234. package/dist/decode/sandhi-tones.d.ts +69 -0
  235. package/dist/decode/sandhi-tones.d.ts.map +1 -0
  236. package/dist/decode/sandhi-tones.js +88 -0
  237. package/dist/decode/sandhi-tones.js.map +1 -0
  238. package/dist/decode/sandhi.d.ts +1 -1
  239. package/dist/decode/sandhi.d.ts.map +1 -1
  240. package/dist/decode/sandhi.js +1 -81
  241. package/dist/decode/sandhi.js.map +1 -1
  242. package/dist/decode/script-types.d.ts +76 -0
  243. package/dist/decode/script-types.d.ts.map +1 -0
  244. package/dist/decode/script-types.js +35 -0
  245. package/dist/decode/script-types.js.map +1 -0
  246. package/dist/decode/script-words.d.ts +32 -0
  247. package/dist/decode/script-words.d.ts.map +1 -0
  248. package/dist/decode/script-words.js +77 -0
  249. package/dist/decode/script-words.js.map +1 -0
  250. package/dist/decode/script.d.ts +3 -73
  251. package/dist/decode/script.d.ts.map +1 -1
  252. package/dist/decode/script.js +3 -109
  253. package/dist/decode/script.js.map +1 -1
  254. package/dist/decode/tan-rule.d.ts +68 -0
  255. package/dist/decode/tan-rule.d.ts.map +1 -0
  256. package/dist/decode/tan-rule.js +131 -0
  257. package/dist/decode/tan-rule.js.map +1 -0
  258. package/dist/decode/write-run.d.ts +28 -0
  259. package/dist/decode/write-run.d.ts.map +1 -0
  260. package/dist/decode/write-run.js +77 -0
  261. package/dist/decode/write-run.js.map +1 -0
  262. package/dist/dictionary/artifact-claims.d.ts +25 -0
  263. package/dist/dictionary/artifact-claims.d.ts.map +1 -0
  264. package/dist/dictionary/artifact-claims.js +47 -0
  265. package/dist/dictionary/artifact-claims.js.map +1 -0
  266. package/dist/dictionary/artifact-format.d.ts +86 -0
  267. package/dist/dictionary/artifact-format.d.ts.map +1 -0
  268. package/dist/dictionary/artifact-format.js +91 -0
  269. package/dist/dictionary/artifact-format.js.map +1 -0
  270. package/dist/dictionary/artifact-read.d.ts +34 -0
  271. package/dist/dictionary/artifact-read.d.ts.map +1 -0
  272. package/dist/dictionary/artifact-read.js +114 -0
  273. package/dist/dictionary/artifact-read.js.map +1 -0
  274. package/dist/dictionary/artifact.d.ts +4 -63
  275. package/dist/dictionary/artifact.d.ts.map +1 -1
  276. package/dist/dictionary/artifact.js +12 -229
  277. package/dist/dictionary/artifact.js.map +1 -1
  278. package/dist/dictionary/assertions.d.ts +5 -57
  279. package/dist/dictionary/assertions.d.ts.map +1 -1
  280. package/dist/dictionary/assertions.js +4 -317
  281. package/dist/dictionary/assertions.js.map +1 -1
  282. package/dist/dictionary/build-assertions.d.ts +12 -0
  283. package/dist/dictionary/build-assertions.d.ts.map +1 -0
  284. package/dist/dictionary/build-assertions.js +13 -0
  285. package/dist/dictionary/build-assertions.js.map +1 -0
  286. package/dist/dictionary/built-dictionary.d.ts +46 -0
  287. package/dist/dictionary/built-dictionary.d.ts.map +1 -0
  288. package/dist/dictionary/built-dictionary.js +97 -0
  289. package/dist/dictionary/built-dictionary.js.map +1 -0
  290. package/dist/dictionary/cedict-senses.d.ts +80 -0
  291. package/dist/dictionary/cedict-senses.d.ts.map +1 -0
  292. package/dist/dictionary/cedict-senses.js +114 -0
  293. package/dist/dictionary/cedict-senses.js.map +1 -0
  294. package/dist/dictionary/character-defaults.d.ts +26 -0
  295. package/dist/dictionary/character-defaults.d.ts.map +1 -0
  296. package/dist/dictionary/character-defaults.js +67 -0
  297. package/dist/dictionary/character-defaults.js.map +1 -0
  298. package/dist/dictionary/character-readings.d.ts +10 -0
  299. package/dist/dictionary/character-readings.d.ts.map +1 -0
  300. package/dist/dictionary/character-readings.js +25 -0
  301. package/dist/dictionary/character-readings.js.map +1 -0
  302. package/dist/dictionary/dictionary-entry.d.ts +37 -0
  303. package/dist/dictionary/dictionary-entry.d.ts.map +1 -0
  304. package/dist/dictionary/dictionary-entry.js +41 -0
  305. package/dist/dictionary/dictionary-entry.js.map +1 -0
  306. package/dist/dictionary/dictionary-readings.d.ts +56 -0
  307. package/dist/dictionary/dictionary-readings.d.ts.map +1 -0
  308. package/dist/dictionary/dictionary-readings.js +93 -0
  309. package/dist/dictionary/dictionary-readings.js.map +1 -0
  310. package/dist/dictionary/dictionary.d.ts +6 -60
  311. package/dist/dictionary/dictionary.d.ts.map +1 -1
  312. package/dist/dictionary/dictionary.js +9 -169
  313. package/dist/dictionary/dictionary.js.map +1 -1
  314. package/dist/dictionary/entry-invariants.d.ts +3 -0
  315. package/dist/dictionary/entry-invariants.d.ts.map +1 -0
  316. package/dist/dictionary/entry-invariants.js +67 -0
  317. package/dist/dictionary/entry-invariants.js.map +1 -0
  318. package/dist/dictionary/entry-lines.d.ts +35 -0
  319. package/dist/dictionary/entry-lines.d.ts.map +1 -0
  320. package/dist/dictionary/entry-lines.js +70 -0
  321. package/dist/dictionary/entry-lines.js.map +1 -0
  322. package/dist/dictionary/erhua-repair.d.ts +26 -0
  323. package/dist/dictionary/erhua-repair.d.ts.map +1 -0
  324. package/dist/dictionary/erhua-repair.js +49 -0
  325. package/dist/dictionary/erhua-repair.js.map +1 -0
  326. package/dist/dictionary/frequency-tones.d.ts +74 -0
  327. package/dist/dictionary/frequency-tones.d.ts.map +1 -0
  328. package/dist/dictionary/frequency-tones.js +128 -0
  329. package/dist/dictionary/frequency-tones.js.map +1 -0
  330. package/dist/dictionary/inventory-invariants.d.ts +3 -0
  331. package/dist/dictionary/inventory-invariants.d.ts.map +1 -0
  332. package/dist/dictionary/inventory-invariants.js +54 -0
  333. package/dist/dictionary/inventory-invariants.js.map +1 -0
  334. package/dist/dictionary/locale-candidates.d.ts +40 -0
  335. package/dist/dictionary/locale-candidates.d.ts.map +1 -0
  336. package/dist/dictionary/locale-candidates.js +77 -0
  337. package/dist/dictionary/locale-candidates.js.map +1 -0
  338. package/dist/dictionary/locale-segments.d.ts +47 -0
  339. package/dist/dictionary/locale-segments.d.ts.map +1 -0
  340. package/dist/dictionary/locale-segments.js +141 -0
  341. package/dist/dictionary/locale-segments.js.map +1 -0
  342. package/dist/dictionary/locale.d.ts +1 -21
  343. package/dist/dictionary/locale.d.ts.map +1 -1
  344. package/dist/dictionary/locale.js +9 -198
  345. package/dist/dictionary/locale.js.map +1 -1
  346. package/dist/dictionary/merge-types.d.ts +121 -0
  347. package/dist/dictionary/merge-types.d.ts.map +1 -0
  348. package/dist/dictionary/merge-types.js +35 -0
  349. package/dist/dictionary/merge-types.js.map +1 -0
  350. package/dist/dictionary/merge-word.d.ts +7 -0
  351. package/dist/dictionary/merge-word.d.ts.map +1 -0
  352. package/dist/dictionary/merge-word.js +91 -0
  353. package/dist/dictionary/merge-word.js.map +1 -0
  354. package/dist/dictionary/merge.d.ts +5 -62
  355. package/dist/dictionary/merge.d.ts.map +1 -1
  356. package/dist/dictionary/merge.js +30 -713
  357. package/dist/dictionary/merge.js.map +1 -1
  358. package/dist/dictionary/proper-noun.d.ts +28 -0
  359. package/dist/dictionary/proper-noun.d.ts.map +1 -0
  360. package/dist/dictionary/proper-noun.js +43 -0
  361. package/dist/dictionary/proper-noun.js.map +1 -0
  362. package/dist/dictionary/reading-agreement.d.ts +71 -0
  363. package/dist/dictionary/reading-agreement.d.ts.map +1 -0
  364. package/dist/dictionary/reading-agreement.js +156 -0
  365. package/dist/dictionary/reading-agreement.js.map +1 -0
  366. package/dist/dictionary/script-conversion.d.ts +28 -0
  367. package/dist/dictionary/script-conversion.d.ts.map +1 -0
  368. package/dist/dictionary/script-conversion.js +58 -0
  369. package/dist/dictionary/script-conversion.js.map +1 -0
  370. package/dist/dictionary/script-pairings.d.ts +74 -0
  371. package/dist/dictionary/script-pairings.d.ts.map +1 -0
  372. package/dist/dictionary/script-pairings.js +120 -0
  373. package/dist/dictionary/script-pairings.js.map +1 -0
  374. package/dist/dictionary/script-tables.d.ts.map +1 -1
  375. package/dist/dictionary/script-tables.js +2 -165
  376. package/dist/dictionary/script-tables.js.map +1 -1
  377. package/dist/dictionary/taiwan-reading.d.ts +8 -0
  378. package/dist/dictionary/taiwan-reading.d.ts.map +1 -0
  379. package/dist/dictionary/taiwan-reading.js +38 -0
  380. package/dist/dictionary/taiwan-reading.js.map +1 -0
  381. package/dist/dictionary/tone-invariants.d.ts +3 -0
  382. package/dist/dictionary/tone-invariants.d.ts.map +1 -0
  383. package/dist/dictionary/tone-invariants.js +64 -0
  384. package/dist/dictionary/tone-invariants.js.map +1 -0
  385. package/dist/dictionary/traditional-form.d.ts +21 -0
  386. package/dist/dictionary/traditional-form.d.ts.map +1 -0
  387. package/dist/dictionary/traditional-form.js +59 -0
  388. package/dist/dictionary/traditional-form.js.map +1 -0
  389. package/dist/dictionary/traditional-ranking.d.ts +22 -0
  390. package/dist/dictionary/traditional-ranking.d.ts.map +1 -0
  391. package/dist/dictionary/traditional-ranking.js +74 -0
  392. package/dist/dictionary/traditional-ranking.js.map +1 -0
  393. package/dist/dictionary/traditional-table.d.ts +51 -0
  394. package/dist/dictionary/traditional-table.d.ts.map +1 -0
  395. package/dist/dictionary/traditional-table.js +98 -0
  396. package/dist/dictionary/traditional-table.js.map +1 -0
  397. package/dist/dictionary/traditional.d.ts +3 -56
  398. package/dist/dictionary/traditional.d.ts.map +1 -1
  399. package/dist/dictionary/traditional.js +3 -186
  400. package/dist/dictionary/traditional.js.map +1 -1
  401. package/dist/dictionary/variant-counts.d.ts +39 -0
  402. package/dist/dictionary/variant-counts.d.ts.map +1 -0
  403. package/dist/dictionary/variant-counts.js +38 -0
  404. package/dist/dictionary/variant-counts.js.map +1 -0
  405. package/dist/dictionary/word-reading.d.ts +26 -0
  406. package/dist/dictionary/word-reading.d.ts.map +1 -0
  407. package/dist/dictionary/word-reading.js +76 -0
  408. package/dist/dictionary/word-reading.js.map +1 -0
  409. package/dist/dictionary/word-readings.d.ts +15 -0
  410. package/dist/dictionary/word-readings.d.ts.map +1 -0
  411. package/dist/dictionary/word-readings.js +38 -0
  412. package/dist/dictionary/word-readings.js.map +1 -0
  413. package/dist/format/annotate.d.ts +90 -0
  414. package/dist/format/annotate.d.ts.map +1 -0
  415. package/dist/format/annotate.js +168 -0
  416. package/dist/format/annotate.js.map +1 -0
  417. package/dist/format/html.d.ts +15 -46
  418. package/dist/format/html.d.ts.map +1 -1
  419. package/dist/format/html.js +3 -162
  420. package/dist/format/html.js.map +1 -1
  421. package/dist/format/slug-hash.d.ts +51 -0
  422. package/dist/format/slug-hash.d.ts.map +1 -0
  423. package/dist/format/slug-hash.js +74 -0
  424. package/dist/format/slug-hash.js.map +1 -0
  425. package/dist/format/slug-options.d.ts +98 -0
  426. package/dist/format/slug-options.d.ts.map +1 -0
  427. package/dist/format/slug-options.js +2 -0
  428. package/dist/format/slug-options.js.map +1 -0
  429. package/dist/format/slug-words.d.ts +27 -0
  430. package/dist/format/slug-words.d.ts.map +1 -0
  431. package/dist/format/slug-words.js +0 -0
  432. package/dist/format/slug-words.js.map +1 -0
  433. package/dist/format/slug.d.ts +3 -128
  434. package/dist/format/slug.d.ts.map +1 -1
  435. package/dist/format/slug.js +0 -0
  436. package/dist/format/slug.js.map +1 -1
  437. package/dist/grade/check-readings.d.ts +41 -0
  438. package/dist/grade/check-readings.d.ts.map +1 -0
  439. package/dist/grade/check-readings.js +36 -0
  440. package/dist/grade/check-readings.js.map +1 -0
  441. package/dist/grade/check.d.ts +4 -4
  442. package/dist/grade/check.d.ts.map +1 -1
  443. package/dist/grade/check.js +5 -270
  444. package/dist/grade/check.js.map +1 -1
  445. package/dist/grade/pair-syllables.d.ts +48 -0
  446. package/dist/grade/pair-syllables.d.ts.map +1 -0
  447. package/dist/grade/pair-syllables.js +71 -0
  448. package/dist/grade/pair-syllables.js.map +1 -0
  449. package/dist/grade/reading-syllables.d.ts +62 -0
  450. package/dist/grade/reading-syllables.d.ts.map +1 -0
  451. package/dist/grade/reading-syllables.js +58 -0
  452. package/dist/grade/reading-syllables.js.map +1 -0
  453. package/dist/grade/reading-tolerance.d.ts +72 -0
  454. package/dist/grade/reading-tolerance.d.ts.map +1 -0
  455. package/dist/grade/reading-tolerance.js +107 -0
  456. package/dist/grade/reading-tolerance.js.map +1 -0
  457. package/dist/grade/typed-reading.d.ts +28 -0
  458. package/dist/grade/typed-reading.d.ts.map +1 -0
  459. package/dist/grade/typed-reading.js +36 -0
  460. package/dist/grade/typed-reading.js.map +1 -0
  461. package/dist/numerals/numeral-parse.d.ts +32 -0
  462. package/dist/numerals/numeral-parse.d.ts.map +1 -0
  463. package/dist/numerals/numeral-parse.js +44 -0
  464. package/dist/numerals/numeral-parse.js.map +1 -0
  465. package/dist/numerals/numeral-shapes.d.ts +89 -0
  466. package/dist/numerals/numeral-shapes.d.ts.map +1 -0
  467. package/dist/numerals/numeral-shapes.js +99 -0
  468. package/dist/numerals/numeral-shapes.js.map +1 -0
  469. package/dist/numerals/numerals.d.ts.map +1 -1
  470. package/dist/numerals/numerals.js +2 -36
  471. package/dist/numerals/numerals.js.map +1 -1
  472. package/dist/numerals/read-numeral.d.ts +76 -0
  473. package/dist/numerals/read-numeral.d.ts.map +1 -0
  474. package/dist/numerals/read-numeral.js +88 -0
  475. package/dist/numerals/read-numeral.js.map +1 -0
  476. package/dist/numerals/text.d.ts +3 -37
  477. package/dist/numerals/text.d.ts.map +1 -1
  478. package/dist/numerals/text.js +3 -254
  479. package/dist/numerals/text.js.map +1 -1
  480. package/dist/numerals/time.d.ts +34 -0
  481. package/dist/numerals/time.d.ts.map +1 -0
  482. package/dist/numerals/time.js +93 -0
  483. package/dist/numerals/time.js.map +1 -0
  484. package/dist/orthography/address-grouping.d.ts +34 -0
  485. package/dist/orthography/address-grouping.d.ts.map +1 -0
  486. package/dist/orthography/address-grouping.js +52 -0
  487. package/dist/orthography/address-grouping.js.map +1 -0
  488. package/dist/orthography/grouping.d.ts +3 -87
  489. package/dist/orthography/grouping.d.ts.map +1 -1
  490. package/dist/orthography/grouping.js +4 -270
  491. package/dist/orthography/grouping.js.map +1 -1
  492. package/dist/orthography/place-grouping.d.ts +39 -0
  493. package/dist/orthography/place-grouping.d.ts.map +1 -0
  494. package/dist/orthography/place-grouping.js +83 -0
  495. package/dist/orthography/place-grouping.js.map +1 -0
  496. package/dist/orthography/word-grouping.d.ts +48 -0
  497. package/dist/orthography/word-grouping.d.ts.map +1 -0
  498. package/dist/orthography/word-grouping.js +147 -0
  499. package/dist/orthography/word-grouping.js.map +1 -0
  500. package/dist/script/conversion-format.d.ts +22 -0
  501. package/dist/script/conversion-format.d.ts.map +1 -0
  502. package/dist/script/conversion-format.js +22 -0
  503. package/dist/script/conversion-format.js.map +1 -0
  504. package/dist/script/conversion-read.d.ts +9 -0
  505. package/dist/script/conversion-read.d.ts.map +1 -0
  506. package/dist/script/conversion-read.js +69 -0
  507. package/dist/script/conversion-read.js.map +1 -0
  508. package/dist/script/conversion-write.d.ts +14 -0
  509. package/dist/script/conversion-write.d.ts.map +1 -0
  510. package/dist/script/conversion-write.js +34 -0
  511. package/dist/script/conversion-write.js.map +1 -0
  512. package/dist/script/conversion.d.ts +10 -16
  513. package/dist/script/conversion.d.ts.map +1 -1
  514. package/dist/script/conversion.js +2 -115
  515. package/dist/script/conversion.js.map +1 -1
  516. package/dist/search/candidate-narrowing.d.ts +56 -0
  517. package/dist/search/candidate-narrowing.d.ts.map +1 -0
  518. package/dist/search/candidate-narrowing.js +55 -0
  519. package/dist/search/candidate-narrowing.js.map +1 -0
  520. package/dist/search/candidate-query.d.ts +25 -0
  521. package/dist/search/candidate-query.d.ts.map +1 -0
  522. package/dist/search/candidate-query.js +28 -0
  523. package/dist/search/candidate-query.js.map +1 -0
  524. package/dist/search/candidate-writings.d.ts +24 -0
  525. package/dist/search/candidate-writings.d.ts.map +1 -0
  526. package/dist/search/candidate-writings.js +114 -0
  527. package/dist/search/candidate-writings.js.map +1 -0
  528. package/dist/search/candidates.d.ts +7 -41
  529. package/dist/search/candidates.d.ts.map +1 -1
  530. package/dist/search/candidates.js +10 -164
  531. package/dist/search/candidates.js.map +1 -1
  532. package/dist/search/match-chunks.d.ts +19 -0
  533. package/dist/search/match-chunks.d.ts.map +1 -0
  534. package/dist/search/match-chunks.js +30 -0
  535. package/dist/search/match-chunks.js.map +1 -0
  536. package/dist/search/match-ranking.d.ts +39 -0
  537. package/dist/search/match-ranking.d.ts.map +1 -0
  538. package/dist/search/match-ranking.js +51 -0
  539. package/dist/search/match-ranking.js.map +1 -0
  540. package/dist/search/match-readings.d.ts +43 -0
  541. package/dist/search/match-readings.d.ts.map +1 -0
  542. package/dist/search/match-readings.js +83 -0
  543. package/dist/search/match-readings.js.map +1 -0
  544. package/dist/search/match-scoring.d.ts +146 -0
  545. package/dist/search/match-scoring.d.ts.map +1 -0
  546. package/dist/search/match-scoring.js +114 -0
  547. package/dist/search/match-scoring.js.map +1 -0
  548. package/dist/search/match-search.d.ts +28 -0
  549. package/dist/search/match-search.d.ts.map +1 -0
  550. package/dist/search/match-search.js +128 -0
  551. package/dist/search/match-search.js.map +1 -0
  552. package/dist/search/match.d.ts +5 -36
  553. package/dist/search/match.d.ts.map +1 -1
  554. package/dist/search/match.js +2 -379
  555. package/dist/search/match.js.map +1 -1
  556. package/dist/search/reverse-index-build.d.ts +30 -0
  557. package/dist/search/reverse-index-build.d.ts.map +1 -0
  558. package/dist/search/reverse-index-build.js +72 -0
  559. package/dist/search/reverse-index-build.js.map +1 -0
  560. package/dist/search/reverse-index-format.d.ts +60 -0
  561. package/dist/search/reverse-index-format.d.ts.map +1 -0
  562. package/dist/search/reverse-index-format.js +54 -0
  563. package/dist/search/reverse-index-format.js.map +1 -0
  564. package/dist/search/reverse-index-groups.d.ts +37 -0
  565. package/dist/search/reverse-index-groups.d.ts.map +1 -0
  566. package/dist/search/reverse-index-groups.js +71 -0
  567. package/dist/search/reverse-index-groups.js.map +1 -0
  568. package/dist/search/reverse-index-passes.d.ts +78 -0
  569. package/dist/search/reverse-index-passes.d.ts.map +1 -0
  570. package/dist/search/reverse-index-passes.js +59 -0
  571. package/dist/search/reverse-index-passes.js.map +1 -0
  572. package/dist/search/reverse-index-state.d.ts +36 -0
  573. package/dist/search/reverse-index-state.d.ts.map +1 -0
  574. package/dist/search/reverse-index-state.js +95 -0
  575. package/dist/search/reverse-index-state.js.map +1 -0
  576. package/dist/search/reverse-index.d.ts +8 -67
  577. package/dist/search/reverse-index.d.ts.map +1 -1
  578. package/dist/search/reverse-index.js +4 -255
  579. package/dist/search/reverse-index.js.map +1 -1
  580. package/dist/sources/unihan-readings.d.ts +58 -0
  581. package/dist/sources/unihan-readings.d.ts.map +1 -0
  582. package/dist/sources/unihan-readings.js +95 -0
  583. package/dist/sources/unihan-readings.js.map +1 -0
  584. package/dist/sources/unihan.d.ts +6 -9
  585. package/dist/sources/unihan.d.ts.map +1 -1
  586. package/dist/sources/unihan.js +2 -85
  587. package/dist/sources/unihan.js.map +1 -1
  588. package/dist/syllable/final-tables.d.ts +23 -0
  589. package/dist/syllable/final-tables.d.ts.map +1 -0
  590. package/dist/syllable/final-tables.js +50 -0
  591. package/dist/syllable/final-tables.js.map +1 -0
  592. package/dist/syllable/inventory.d.ts +8 -42
  593. package/dist/syllable/inventory.d.ts.map +1 -1
  594. package/dist/syllable/inventory.js +9 -918
  595. package/dist/syllable/inventory.js.map +1 -1
  596. package/dist/syllable/spellings.d.ts +40 -0
  597. package/dist/syllable/spellings.d.ts.map +1 -0
  598. package/dist/syllable/spellings.js +469 -0
  599. package/dist/syllable/spellings.js.map +1 -0
  600. package/dist/syllable/syllable-parts.d.ts +31 -0
  601. package/dist/syllable/syllable-parts.d.ts.map +1 -0
  602. package/dist/syllable/syllable-parts.js +105 -0
  603. package/dist/syllable/syllable-parts.js.map +1 -0
  604. package/dist/syllable/syllable.d.ts +1 -14
  605. package/dist/syllable/syllable.d.ts.map +1 -1
  606. package/dist/syllable/syllable.js +3 -144
  607. package/dist/syllable/syllable.js.map +1 -1
  608. package/dist/syllable/written-tones.d.ts +6 -0
  609. package/dist/syllable/written-tones.d.ts.map +1 -0
  610. package/dist/syllable/written-tones.js +453 -0
  611. package/dist/syllable/written-tones.js.map +1 -0
  612. package/dist/transcription/bopomofo-parse.d.ts +42 -0
  613. package/dist/transcription/bopomofo-parse.d.ts.map +1 -0
  614. package/dist/transcription/bopomofo-parse.js +92 -0
  615. package/dist/transcription/bopomofo-parse.js.map +1 -0
  616. package/dist/transcription/bopomofo-reverse.d.ts +31 -0
  617. package/dist/transcription/bopomofo-reverse.d.ts.map +1 -0
  618. package/dist/transcription/bopomofo-reverse.js +48 -0
  619. package/dist/transcription/bopomofo-reverse.js.map +1 -0
  620. package/dist/transcription/bopomofo-symbols.d.ts +36 -0
  621. package/dist/transcription/bopomofo-symbols.d.ts.map +1 -0
  622. package/dist/transcription/bopomofo-symbols.js +41 -0
  623. package/dist/transcription/bopomofo-symbols.js.map +1 -0
  624. package/dist/transcription/bopomofo-tables.d.ts +87 -0
  625. package/dist/transcription/bopomofo-tables.d.ts.map +1 -0
  626. package/dist/transcription/bopomofo-tables.js +180 -0
  627. package/dist/transcription/bopomofo-tables.js.map +1 -0
  628. package/dist/transcription/bopomofo.d.ts +14 -32
  629. package/dist/transcription/bopomofo.d.ts.map +1 -1
  630. package/dist/transcription/bopomofo.js +5 -343
  631. package/dist/transcription/bopomofo.js.map +1 -1
  632. package/dist/transcription/gwoyeu-first-second.d.ts +36 -0
  633. package/dist/transcription/gwoyeu-first-second.d.ts.map +1 -0
  634. package/dist/transcription/gwoyeu-first-second.js +75 -0
  635. package/dist/transcription/gwoyeu-first-second.js.map +1 -0
  636. package/dist/transcription/gwoyeu-spelling.d.ts +38 -0
  637. package/dist/transcription/gwoyeu-spelling.d.ts.map +1 -0
  638. package/dist/transcription/gwoyeu-spelling.js +124 -0
  639. package/dist/transcription/gwoyeu-spelling.js.map +1 -0
  640. package/dist/transcription/gwoyeu-tables.d.ts +93 -0
  641. package/dist/transcription/gwoyeu-tables.d.ts.map +1 -0
  642. package/dist/transcription/gwoyeu-tables.js +205 -0
  643. package/dist/transcription/gwoyeu-tables.js.map +1 -0
  644. package/dist/transcription/gwoyeu-tonal-forms.d.ts +49 -0
  645. package/dist/transcription/gwoyeu-tonal-forms.d.ts.map +1 -0
  646. package/dist/transcription/gwoyeu-tonal-forms.js +89 -0
  647. package/dist/transcription/gwoyeu-tonal-forms.js.map +1 -0
  648. package/dist/transcription/gwoyeu-vowels.d.ts +51 -0
  649. package/dist/transcription/gwoyeu-vowels.d.ts.map +1 -0
  650. package/dist/transcription/gwoyeu-vowels.js +58 -0
  651. package/dist/transcription/gwoyeu-vowels.js.map +1 -0
  652. package/dist/transcription/gwoyeu.d.ts +1 -26
  653. package/dist/transcription/gwoyeu.d.ts.map +1 -1
  654. package/dist/transcription/gwoyeu.js +2 -540
  655. package/dist/transcription/gwoyeu.js.map +1 -1
  656. package/dist/transcription/ipa-symbols.d.ts +67 -0
  657. package/dist/transcription/ipa-symbols.d.ts.map +1 -0
  658. package/dist/transcription/ipa-symbols.js +135 -0
  659. package/dist/transcription/ipa-symbols.js.map +1 -0
  660. package/dist/transcription/ipa.d.ts +2 -10
  661. package/dist/transcription/ipa.d.ts.map +1 -1
  662. package/dist/transcription/ipa.js +2 -134
  663. package/dist/transcription/ipa.js.map +1 -1
  664. package/dist/transcription/wade-giles-index.d.ts +35 -0
  665. package/dist/transcription/wade-giles-index.d.ts.map +1 -0
  666. package/dist/transcription/wade-giles-index.js +110 -0
  667. package/dist/transcription/wade-giles-index.js.map +1 -0
  668. package/dist/transcription/wade-giles-parse.d.ts +36 -0
  669. package/dist/transcription/wade-giles-parse.d.ts.map +1 -0
  670. package/dist/transcription/wade-giles-parse.js +84 -0
  671. package/dist/transcription/wade-giles-parse.js.map +1 -0
  672. package/dist/transcription/wade-giles-spelling.d.ts +61 -0
  673. package/dist/transcription/wade-giles-spelling.d.ts.map +1 -0
  674. package/dist/transcription/wade-giles-spelling.js +107 -0
  675. package/dist/transcription/wade-giles-spelling.js.map +1 -0
  676. package/dist/transcription/wade-giles-syllable.d.ts +29 -0
  677. package/dist/transcription/wade-giles-syllable.d.ts.map +1 -0
  678. package/dist/transcription/wade-giles-syllable.js +90 -0
  679. package/dist/transcription/wade-giles-syllable.js.map +1 -0
  680. package/dist/transcription/wade-giles-tables.d.ts +80 -0
  681. package/dist/transcription/wade-giles-tables.d.ts.map +1 -0
  682. package/dist/transcription/wade-giles-tables.js +178 -0
  683. package/dist/transcription/wade-giles-tables.js.map +1 -0
  684. package/dist/transcription/wade-giles.d.ts +9 -60
  685. package/dist/transcription/wade-giles.d.ts.map +1 -1
  686. package/dist/transcription/wade-giles.js +6 -543
  687. package/dist/transcription/wade-giles.js.map +1 -1
  688. package/dist/transcription/yale-tables.d.ts +54 -0
  689. package/dist/transcription/yale-tables.d.ts.map +1 -0
  690. package/dist/transcription/yale-tables.js +125 -0
  691. package/dist/transcription/yale-tables.js.map +1 -0
  692. package/dist/transcription/yale.d.ts.map +1 -1
  693. package/dist/transcription/yale.js +1 -124
  694. package/dist/transcription/yale.js.map +1 -1
  695. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"merge.js","sourceRoot":"","sources":["../../src/dictionary/merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAoB,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAmB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EACL,eAAe,GAGhB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAwB,aAAa,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,WAAW,EAEX,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AA4D1B;;GAEG;AACH,SAAS,U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
@@ -0,0 +1,28 @@
1
+ import { type CedictEntry } from "../sources/cedict.js";
2
+ import { type JiebaEntry } from "../sources/jieba.js";
3
+ import type { Syllable } from "../syllable/syllable.js";
4
+ /**
5
+ * What the sources between them say about a word's name-hood.
6
+ */
7
+ export interface ProperNoun {
8
+ readonly isProperNoun: boolean;
9
+ /** Where the 姓 ends, in characters, or empty where nothing says. */
10
+ readonly boundaries: readonly number[];
11
+ /** Whether jieba proposed a proper noun that CC-CEDICT vetoed. */
12
+ readonly isVetoed: boolean;
13
+ }
14
+ /**
15
+ * Settle it for one word.
16
+ *
17
+ * The veto only ever demotes, never promotes. CC-CEDICT capitalises the pinyin
18
+ * of a proper noun, which is a claim about the word rather than a category it
19
+ * was sorted into — but it also capitalises any headword written with Latin
20
+ * letters, so a capital there is not proof on its own. A lowercase one is much
21
+ * better evidence, since nothing else would write it that way.
22
+ *
23
+ * The boundary is only looked for where the word survived the veto and reads
24
+ * one syllable per character: 儿化 reads two characters as one syllable and
25
+ * could not be cut by a count of characters.
26
+ */
27
+ export declare function properNounOf(word: string, jiebaEntry: JiebaEntry | undefined, cedictEntries: readonly CedictEntry[], senses: readonly CedictEntry[], reading: readonly Syllable[]): ProperNoun;
28
+ //# sourceMappingURL=proper-noun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proper-noun.d.ts","sourceRoot":"","sources":["../../src/dictionary/proper-noun.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,WAAW,EAAoB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,oEAAoE;IACpE,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,kEAAkE;IAClE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,UAAU,GAAG,SAAS,EAClC,aAAa,EAAE,SAAS,WAAW,EAAE,EACrC,MAAM,EAAE,SAAS,WAAW,EAAE,EAC9B,OAAO,EAAE,SAAS,QAAQ,EAAE,GAC3B,UAAU,CAmBZ"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Whether an entry is a proper noun, and where its 姓 ends.
3
+ *
4
+ * jieba's tags propose a proper noun and CC-CEDICT's capitalisation can veto
5
+ * it. The tags on their own are noisy enough to be worth correcting — 沙发,
6
+ * 城市, 阿姨, 智能卡 and 花生仁 are all tagged nr or nz, and the decoder
7
+ * capitalises straight off this bit.
8
+ */
9
+ import { characterCount } from "../script/characters.js";
10
+ import { nameBoundariesOf } from "../sources/cedict.js";
11
+ import { isProperNounTag } from "../sources/jieba.js";
12
+ /**
13
+ * Settle it for one word.
14
+ *
15
+ * The veto only ever demotes, never promotes. CC-CEDICT capitalises the pinyin
16
+ * of a proper noun, which is a claim about the word rather than a category it
17
+ * was sorted into — but it also capitalises any headword written with Latin
18
+ * letters, so a capital there is not proof on its own. A lowercase one is much
19
+ * better evidence, since nothing else would write it that way.
20
+ *
21
+ * The boundary is only looked for where the word survived the veto and reads
22
+ * one syllable per character: 儿化 reads two characters as one syllable and
23
+ * could not be cut by a count of characters.
24
+ */
25
+ export function properNounOf(word, jiebaEntry, cedictEntries, senses, reading) {
26
+ const partOfSpeech = jiebaEntry?.partOfSpeech ?? "";
27
+ const isProperNoun = jiebaEntry === undefined
28
+ ? cedictEntries.some((entry) => entry.isProperNoun)
29
+ : isProperNounTag(partOfSpeech) &&
30
+ (senses.length === 0 || senses.some((entry) => entry.isProperNoun));
31
+ const isAligned = characterCount(word) === reading.length;
32
+ const boundaries = isProperNoun && isAligned
33
+ ? (cedictEntries
34
+ .map((entry) => nameBoundariesOf(entry.readings))
35
+ .find((found) => found.length > 0) ?? [])
36
+ : [];
37
+ return {
38
+ isProperNoun,
39
+ boundaries,
40
+ isVetoed: isProperNounTag(partOfSpeech) && !isProperNoun,
41
+ };
42
+ }
43
+ //# sourceMappingURL=proper-noun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proper-noun.js","sourceRoot":"","sources":["../../src/dictionary/proper-noun.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAoB,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAmB,MAAM,qBAAqB,CAAC;AAcvE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAY,EACZ,UAAkC,EAClC,aAAqC,EACrC,MAA8B,EAC9B,OAA4B;IAE5B,MAAM,YAAY,GAAG,UAAU,EAAE,YAAY,IAAI,EAAE,CAAC;IACpD,MAAM,YAAY,GAChB,UAAU,KAAK,SAAS;QACtB,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC;QACnD,CAAC,CAAC,eAAe,CAAC,YAAY,CAAC;YAC7B,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;IAC1E,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC;IAC1D,MAAM,UAAU,GACd,YAAY,IAAI,SAAS;QACvB,CAAC,CAAC,CAAC,aAAa;aACX,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;aAChD,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QAC7C,CAAC,CAAC,EAAE,CAAC;IACT,OAAO;QACL,YAAY;QACZ,UAAU;QACV,QAAQ,EAAE,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY;KACzD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Reconciling the phrase corpus's reading of a word with CC-CEDICT's.
3
+ *
4
+ * The two sources disagree, and almost always about 轻声. These are the
5
+ * measurements the merge uses to decide which of CC-CEDICT's senses is talking
6
+ * about the same pronunciation, and how much of it to take.
7
+ */
8
+ import type { CedictEntry } from "../sources/cedict.js";
9
+ import type { Syllable } from "../syllable/syllable.js";
10
+ /**
11
+ * Take CC-CEDICT's neutral tones where it and the phrase corpus disagree.
12
+ *
13
+ * The disagreements between the two are almost entirely about 轻声, and
14
+ * CC-CEDICT is the more careful source there: it has 头发 as `tou2 fa5` and
15
+ * 还是 as `hai2 shi5` where the phrase corpus writes full tones on both. Only
16
+ * the tone is taken, and only when it is neutral — a disagreement about the
17
+ * syllable itself is left to the phrase corpus, which has three times the
18
+ * coverage and is the primary source.
19
+ *
20
+ * The two readings must be the same length, which the caller establishes by
21
+ * only passing a sense {@link readingGap} scored as finite.
22
+ */
23
+ export declare function preferNeutralTones(phrase: readonly Syllable[], cedict: readonly Syllable[]): readonly Syllable[];
24
+ /**
25
+ * Whether a word's trailing 儿 is an r suffix rather than a syllable.
26
+ *
27
+ * CC-CEDICT decides wherever it has the word, because its `r5` token is an
28
+ * explicit and reliable marker. Only where it is silent does the checked-in
29
+ * exception list get a say, and there the default is 儿化 — a trailing 儿 is
30
+ * far more often a diminutive suffix than the word 儿 itself.
31
+ */
32
+ export declare function isErhua(word: string, cedictReadings: readonly (readonly Syllable[])[]): boolean;
33
+ /**
34
+ * Whether a candidate reads a syllable 轻声 that the chosen reading tones.
35
+ *
36
+ * What separates a sense that is the same word said more carefully from one
37
+ * that is a different word: 东西's `dong1 xi5` reduces the `dōng xī` the corpus
38
+ * wrote, while its `dong1 xi1` is that same reading and 行长's `háng zhang` has
39
+ * a different initial. Length is checked because a reading of another length
40
+ * describes another pronunciation entirely.
41
+ */
42
+ export declare function reducesToNeutral(reading: readonly Syllable[], candidate: readonly Syllable[]): boolean;
43
+ /**
44
+ * The candidate reading nearest the chosen one, or undefined if none compares.
45
+ *
46
+ * Undefined covers both having no candidates at all and having only candidates
47
+ * of a different length, which describe a different pronunciation rather than a
48
+ * more careful transcription of this one.
49
+ */
50
+ export declare function nearestReading(reading: readonly Syllable[], candidates: readonly (readonly Syllable[])[]): readonly Syllable[] | undefined;
51
+ /**
52
+ * The CC-CEDICT senses describing the pronunciation chosen for a word.
53
+ *
54
+ * A word with several pronunciations has several CC-CEDICT entries, and they
55
+ * can disagree about more than the reading: 万 is written 萬 when read `wàn` and
56
+ * 万 when read `mò`. Everything taken from CC-CEDICT for an entry — its 繁體
57
+ * form, its Taiwan reading — has to come from a sense that matches the reading,
58
+ * or the entry ends up describing two different words at once.
59
+ *
60
+ * Every sense equally near the reading is returned, most useful first, because
61
+ * senses can agree about the pronunciation and still differ about the script:
62
+ * 重复 is `chóng fù` whether it is written 重複 or 重覆, and both spellings are
63
+ * this word. The first is the entry's 繁體 form and the rest are its
64
+ * {@link import("./entry.js").DictionaryEntry.hantVariants}.
65
+ *
66
+ * Where nothing compares — no sense has a readable reading of the same length —
67
+ * only the first is returned. A tie between senses that could not be measured
68
+ * is not evidence that they are the same word.
69
+ */
70
+ export declare function sensesForReading(word: string, entries: readonly CedictEntry[], reading: readonly Syllable[]): readonly CedictEntry[];
71
+ //# sourceMappingURL=reading-agreement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reading-agreement.d.ts","sourceRoot":"","sources":["../../src/dictionary/reading-agreement.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AA0CxD;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,QAAQ,EAAE,EAC3B,MAAM,EAAE,SAAS,QAAQ,EAAE,GAC1B,SAAS,QAAQ,EAAE,CAYrB;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,SAAS,CAAC,SAAS,QAAQ,EAAE,CAAC,EAAE,GAC/C,OAAO,CAQT;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,SAAS,QAAQ,EAAE,EAC5B,SAAS,EAAE,SAAS,QAAQ,EAAE,GAC7B,OAAO,CAcT;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,SAAS,QAAQ,EAAE,EAC5B,UAAU,EAAE,SAAS,CAAC,SAAS,QAAQ,EAAE,CAAC,EAAE,GAC3C,SAAS,QAAQ,EAAE,GAAG,SAAS,CAWjC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAAS,WAAW,EAAE,EAC/B,OAAO,EAAE,SAAS,QAAQ,EAAE,GAC3B,SAAS,WAAW,EAAE,CAexB"}
@@ -0,0 +1,156 @@
1
+ import { NEUTRAL_TONE } from "../tone/tone.js";
2
+ import { isErFinal, NON_ERHUA_ER_WORDS } from "./erhua.js";
3
+ import { readDictionaryReading } from "./reading.js";
4
+ /**
5
+ * How far apart two readings of the same length are.
6
+ *
7
+ * Used to pick which of CC-CEDICT's senses to compare against, since a word
8
+ * with several senses has several readings and only the nearest one is talking
9
+ * about the same pronunciation.
10
+ *
11
+ * A difference in spelling counts for more than a difference in tone, and the
12
+ * distinction decides real cases. 行长 is `xíng zhǎng` in one CC-CEDICT sense
13
+ * and `háng zhang` in another; against the phrase corpus's `háng zhǎng` the two
14
+ * differ in one syllable each, but only the second is the same word — the first
15
+ * has a different initial, so it is a different word that happens to be
16
+ * written the same way.
17
+ */
18
+ function readingGap(left, right) {
19
+ if (left.length !== right.length) {
20
+ return Infinity;
21
+ }
22
+ let spelling = 0;
23
+ let tones = 0;
24
+ for (const [at, syllable] of left.entries()) {
25
+ /* c8 ignore next -- the lengths match, so the fallback is unreachable */
26
+ const other = right[at] ?? syllable;
27
+ if (syllable.initial !== other.initial || syllable.final !== other.final) {
28
+ spelling++;
29
+ }
30
+ else if (syllable.tone !== other.tone) {
31
+ tones++;
32
+ }
33
+ }
34
+ // Scaled so that any number of tone differences still beats one spelling
35
+ // difference.
36
+ return spelling * (left.length + 1) + tones;
37
+ }
38
+ /**
39
+ * Take CC-CEDICT's neutral tones where it and the phrase corpus disagree.
40
+ *
41
+ * The disagreements between the two are almost entirely about 轻声, and
42
+ * CC-CEDICT is the more careful source there: it has 头发 as `tou2 fa5` and
43
+ * 还是 as `hai2 shi5` where the phrase corpus writes full tones on both. Only
44
+ * the tone is taken, and only when it is neutral — a disagreement about the
45
+ * syllable itself is left to the phrase corpus, which has three times the
46
+ * coverage and is the primary source.
47
+ *
48
+ * The two readings must be the same length, which the caller establishes by
49
+ * only passing a sense {@link readingGap} scored as finite.
50
+ */
51
+ export function preferNeutralTones(phrase, cedict) {
52
+ return phrase.map((syllable, at) => {
53
+ /* c8 ignore next -- the caller only passes a sense of the same length */
54
+ const other = cedict[at] ?? syllable;
55
+ const isSameSound = syllable.initial === other.initial && syllable.final === other.final;
56
+ return isSameSound &&
57
+ other.tone === NEUTRAL_TONE &&
58
+ syllable.tone !== NEUTRAL_TONE
59
+ ? { ...syllable, tone: NEUTRAL_TONE }
60
+ : syllable;
61
+ });
62
+ }
63
+ /**
64
+ * Whether a word's trailing 儿 is an r suffix rather than a syllable.
65
+ *
66
+ * CC-CEDICT decides wherever it has the word, because its `r5` token is an
67
+ * explicit and reliable marker. Only where it is silent does the checked-in
68
+ * exception list get a say, and there the default is 儿化 — a trailing 儿 is
69
+ * far more often a diminutive suffix than the word 儿 itself.
70
+ */
71
+ export function isErhua(word, cedictReadings) {
72
+ if (!isErFinal(word)) {
73
+ return false;
74
+ }
75
+ if (cedictReadings.length > 0) {
76
+ return cedictReadings.some((reading) => reading.at(-1)?.erhua === true);
77
+ }
78
+ return !NON_ERHUA_ER_WORDS.has(word);
79
+ }
80
+ /**
81
+ * Whether a candidate reads a syllable 轻声 that the chosen reading tones.
82
+ *
83
+ * What separates a sense that is the same word said more carefully from one
84
+ * that is a different word: 东西's `dong1 xi5` reduces the `dōng xī` the corpus
85
+ * wrote, while its `dong1 xi1` is that same reading and 行长's `háng zhang` has
86
+ * a different initial. Length is checked because a reading of another length
87
+ * describes another pronunciation entirely.
88
+ */
89
+ export function reducesToNeutral(reading, candidate) {
90
+ if (reading.length !== candidate.length) {
91
+ return false;
92
+ }
93
+ return reading.some((syllable, at) => {
94
+ const other = candidate[at];
95
+ return (other !== undefined &&
96
+ syllable.initial === other.initial &&
97
+ syllable.final === other.final &&
98
+ syllable.tone !== NEUTRAL_TONE &&
99
+ other.tone === NEUTRAL_TONE);
100
+ });
101
+ }
102
+ /**
103
+ * The candidate reading nearest the chosen one, or undefined if none compares.
104
+ *
105
+ * Undefined covers both having no candidates at all and having only candidates
106
+ * of a different length, which describe a different pronunciation rather than a
107
+ * more careful transcription of this one.
108
+ */
109
+ export function nearestReading(reading, candidates) {
110
+ let nearest;
111
+ let smallest = Infinity;
112
+ for (const candidate of candidates) {
113
+ const gap = readingGap(reading, candidate);
114
+ if (gap < smallest) {
115
+ nearest = candidate;
116
+ smallest = gap;
117
+ }
118
+ }
119
+ return nearest;
120
+ }
121
+ /**
122
+ * The CC-CEDICT senses describing the pronunciation chosen for a word.
123
+ *
124
+ * A word with several pronunciations has several CC-CEDICT entries, and they
125
+ * can disagree about more than the reading: 万 is written 萬 when read `wàn` and
126
+ * 万 when read `mò`. Everything taken from CC-CEDICT for an entry — its 繁體
127
+ * form, its Taiwan reading — has to come from a sense that matches the reading,
128
+ * or the entry ends up describing two different words at once.
129
+ *
130
+ * Every sense equally near the reading is returned, most useful first, because
131
+ * senses can agree about the pronunciation and still differ about the script:
132
+ * 重复 is `chóng fù` whether it is written 重複 or 重覆, and both spellings are
133
+ * this word. The first is the entry's 繁體 form and the rest are its
134
+ * {@link import("./entry.js").DictionaryEntry.hantVariants}.
135
+ *
136
+ * Where nothing compares — no sense has a readable reading of the same length —
137
+ * only the first is returned. A tie between senses that could not be measured
138
+ * is not evidence that they are the same word.
139
+ */
140
+ export function sensesForReading(word, entries, reading) {
141
+ const measured = entries.map((entry) => {
142
+ const candidate = readDictionaryReading(word, entry.readings);
143
+ return {
144
+ entry,
145
+ gap: candidate === undefined ? Infinity : readingGap(reading, candidate),
146
+ };
147
+ });
148
+ const nearest = Math.min(...measured.map(({ gap }) => gap));
149
+ if (measured.length === 0 || nearest === Infinity) {
150
+ return entries.slice(0, 1);
151
+ }
152
+ return measured
153
+ .filter(({ gap }) => gap === nearest)
154
+ .map(({ entry }) => entry);
155
+ }
156
+ //# sourceMappingURL=reading-agreement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reading-agreement.js","sourceRoot":"","sources":["../../src/dictionary/reading-agreement.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,SAAS,UAAU,CACjB,IAAyB,EACzB,KAA0B;IAE1B,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;QACjC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,CAAC,EAAE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G,CAAC;QACjB,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAAY,EACZ,OAA+B,EAC/B,OAA4B;IAE5B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACrC,MAAM,SAAS,GAAG,qBAAqB,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC9D,OAAO;YACL,KAAK;YACL,GAAG,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC;SACzE,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QAClD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,QAAQ;SACZ,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,OAAO,CAAC;SACpC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Reading a conversion out of the tally, and finding the rivals to it.
3
+ *
4
+ * A pairing is taken only where one 繁體 form clearly leads and the reading
5
+ * agrees; where two forms are close the character is left to the reading.
6
+ */
7
+ import type { CharacterConversion } from "../script/conversion.js";
8
+ import { type ByReading, type FormCounts } from "./script-pairings.js";
9
+ /**
10
+ * Reduce one character's observations to a default and its exceptions.
11
+ *
12
+ * A character with only one observed form needs no entry at all when that form
13
+ * is itself — simplification changed a minority of characters, and storing the
14
+ * other 40,000 as identities would be most of the file.
15
+ */
16
+ export declare function conversionOf(from: string, byReading: ByReading): CharacterConversion | undefined;
17
+ /**
18
+ * The forms a character takes often enough to make it genuinely ambiguous.
19
+ *
20
+ * Forms a reading already accounts for are left out: those are settled evidence
21
+ * rather than open questions, and repeating them here would report 发 as a
22
+ * guess in 头发 when the reading decided it.
23
+ */
24
+ export declare function rivalsOf(counts: FormCounts | undefined, chosen: string, exceptions: ReadonlyMap<string, string>): readonly string[];
25
+ /**
26
+ * Reduce every character's observations into a table.
27
+ */
28
+ //# sourceMappingURL=script-conversion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-conversion.d.ts","sourceRoot":"","sources":["../../src/dictionary/script-conversion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,UAAU,EAIhB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,SAAS,GACnB,mBAAmB,GAAG,SAAS,CA6BjC;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACtC,SAAS,MAAM,EAAE,CAenB;AAED;;GAEG"}
@@ -0,0 +1,58 @@
1
+ import { ANY, commonest, READING_AGREEMENT, RIVAL_SHARE, } from "./script-pairings.js";
2
+ /**
3
+ * Reduce one character's observations to a default and its exceptions.
4
+ *
5
+ * A character with only one observed form needs no entry at all when that form
6
+ * is itself — simplification changed a minority of characters, and storing the
7
+ * other 40,000 as identities would be most of the file.
8
+ */
9
+ export function conversionOf(from, byReading) {
10
+ const overall = commonest(from, byReading.get(ANY));
11
+ if (overall === undefined) {
12
+ return undefined;
13
+ }
14
+ const exceptions = new Map();
15
+ for (const [key, counts] of byReading) {
16
+ const at = commonest(from, counts);
17
+ if (key !== ANY &&
18
+ at !== undefined &&
19
+ at.form !== overall.form &&
20
+ at.share >= READING_AGREEMENT) {
21
+ exceptions.set(key, at.form);
22
+ }
23
+ }
24
+ const also = rivalsOf(byReading.get(ANY), overall.form, exceptions);
25
+ if (overall.form === from && exceptions.size === 0 && also.length === 0) {
26
+ return undefined;
27
+ }
28
+ return {
29
+ to: overall.form,
30
+ ...(exceptions.size > 0 && { byReading: exceptions }),
31
+ ...(also.length > 0 && { also }),
32
+ };
33
+ }
34
+ /**
35
+ * The forms a character takes often enough to make it genuinely ambiguous.
36
+ *
37
+ * Forms a reading already accounts for are left out: those are settled evidence
38
+ * rather than open questions, and repeating them here would report 发 as a
39
+ * guess in 头发 when the reading decided it.
40
+ */
41
+ export function rivalsOf(counts, chosen, exceptions) {
42
+ if (counts === undefined) {
43
+ return [];
44
+ }
45
+ let total = 0;
46
+ for (const count of counts.values()) {
47
+ total += count;
48
+ }
49
+ const settled = new Set([chosen, ...exceptions.values()]);
50
+ return [...counts]
51
+ .filter(([form, count]) => !settled.has(form) && count / total >= RIVAL_SHARE)
52
+ .toSorted(([, left], [, right]) => right - left)
53
+ .map(([form]) => form);
54
+ }
55
+ /**
56
+ * Reduce every character's observations into a table.
57
+ */
58
+ //# sourceMappingURL=script-conversion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-conversion.js","sourceRoot":"","sources":["../../src/dictionary/script-conversion.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,GAAG,EAGH,SAAS,EACT,iBAAiB,EACjB,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAY,EACZ,SAAoB;IAEpB,MAAM,O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AE,CAAC;QACzB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;QACpC,KAAK,IAAI,KAAK,CAAC;IACjB,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC1D,OAAO,CAAC,GAAG,MAAM,CAAC;SACf,MAAM,CACL,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,GAAG,KAAK,IAAI,WAAW,CACtE;SACA,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC;SAC/C,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED;;GAEG"}
@@ -0,0 +1,74 @@
1
+ export { conversionOf, rivalsOf } from "./script-conversion.js";
2
+ import { type CharacterConversion } from "../script/conversion.js";
3
+ import type { Syllable } from "../syllable/syllable.js";
4
+ import type { DictionaryEntry } from "./entry.js";
5
+ /**
6
+ * How often one character was written as another, at one reading.
7
+ */
8
+ export type FormCounts = Map<string, number>;
9
+ /**
10
+ * Observed pairings for one character: counts at each reading, and overall.
11
+ */
12
+ export type ByReading = Map<string, FormCounts>;
13
+ /**
14
+ * The key standing for "at any reading".
15
+ */
16
+ export declare const ANY = "";
17
+ /**
18
+ * How much of a reading's evidence must agree before it overrides the default.
19
+ *
20
+ * A reading that disagrees with the default only earns a line in the table if
21
+ * the sources are reasonably united about it. Below this it is noise — one
22
+ * mis-aligned entry, or a spelling nobody else uses — and storing it would
23
+ * make the conversion worse at the cost of bytes.
24
+ */
25
+ export declare const READING_AGREEMENT = 0.8;
26
+ /**
27
+ * How much of a character's evidence a rival form needs to be worth reporting.
28
+ *
29
+ * This decides honesty rather than output: a form listed here makes the
30
+ * character *ambiguous*, so every conversion of it is reported as a guess
31
+ * unless a word or a reading settled it. Set too low and 和 is doubtful because
32
+ * Unihan knows 咊; set too high and 面 looks certain when only the word tells
33
+ * 面 from 麵. A twentieth of the evidence is enough to be a real spelling and
34
+ * far more than the one-off variants clear.
35
+ */
36
+ export declare const RIVAL_SHARE = 0.05;
37
+ /**
38
+ * The pairings an entry attests, character by character.
39
+ *
40
+ * Entries whose two scripts are written with a different number of characters
41
+ * are skipped rather than aligned by guesswork, for the same reason
42
+ * `pairScripts` skips them: an invented alignment is evidence for a pairing
43
+ * nobody wrote.
44
+ */
45
+ export declare function pairingsOf(entry: DictionaryEntry): readonly {
46
+ hans: string;
47
+ hant: string;
48
+ key: string;
49
+ }[];
50
+ /**
51
+ * Tally one pairing under both its own reading and the any-reading key.
52
+ */
53
+ export declare function tally(observed: Map<string, ByReading>, from: string, to: string, key: string, weight: number): void;
54
+ /**
55
+ * The commonest form in a tally, and what share of the evidence it holds.
56
+ *
57
+ * A tie prefers a form other than the character itself, and that matters more
58
+ * than it looks. Every character has an entry of its own where both scripts are
59
+ * the same string, so a character attested in exactly one cross-script word
60
+ * arrives here tied one-all against its own identity — 儁 against 㑺. The real
61
+ * pairing is the one somebody wrote down; the identity is an artefact of how
62
+ * the dictionary is keyed. `TraditionalTable` breaks the same tie the same way.
63
+ */
64
+ export declare function commonest(from: string, counts: FormCounts | undefined): {
65
+ form: string;
66
+ share: number;
67
+ } | undefined;
68
+ export declare function tableOf(observed: Map<string, ByReading>): ReadonlyMap<string, CharacterConversion>;
69
+ /**
70
+ * The readings a word is converted with, where they line up character by
71
+ * character.
72
+ */
73
+ export declare function alignedReadings(entry: DictionaryEntry): readonly (Syllable | undefined)[];
74
+ //# sourceMappingURL=script-pairings.d.ts.map
@@ -0,0 +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