@gukhanmun/wasm 0.1.2 → 0.2.0-dev.119

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -18,7 +18,7 @@
18
18
  * disambiguation, and the bundled *Standard Korean Language Dictionary*
19
19
  * (標準國語大辭典). Corresponds to Rust `Preset::KoKr`.
20
20
  * - `"ko-kp"` — North Korean orthography: no initial sound law (래일,
21
- * 류행, 녀자), no bundled dictionary. Corresponds to Rust `Preset::KoKp`.
21
+ * 류행, 녀자), no bundled dictionary data. Corresponds to Rust `Preset::KoKp`.
22
22
  *
23
23
  * Both presets default `rendering` to `"hangul-only"` and `segmentation` to
24
24
  * `"lattice"`. Individual options passed to {@link GukhanmunOptions} override
@@ -363,6 +363,19 @@ interface GukhanmunOptions {
363
363
  * @see {@link ContextWindow}
364
364
  */
365
365
  readonly firstOccurrenceWindow?: ContextWindow;
366
+ /**
367
+ * Whether to collapse redundant parenthetical reading annotations. Defaults
368
+ * to `true`.
369
+ *
370
+ * When enabled, an explicit gloss such as `庫間(곳간)` or `곳간(庫間)` is
371
+ * recognised, the redundant parenthetical is removed, and the annotation is
372
+ * shown in both scripts in every render mode. A parenthetical that pins an
373
+ * alternative reading (for example `數字(수자)`) overrides the dictionary
374
+ * reading for that occurrence. A parenthetical that is a definition rather
375
+ * than a reading (for example `庫間(물건을 간직하여 두는 곳)`) is left
376
+ * untouched.
377
+ */
378
+ readonly collapseRedundantParens?: boolean;
366
379
  /**
367
380
  * Error recovery policy for HTML scanning. Defaults to `"strict"`.
368
381
  * Ignored for non-HTML input formats.
@@ -373,12 +386,14 @@ interface GukhanmunOptions {
373
386
  /**
374
387
  * Ordered list of dictionary sources. Sources are queried in order;
375
388
  * earlier entries take precedence. When omitted (or empty), only the
376
- * fallback Unihan character map is used (no stdict).
389
+ * fallback Unihan character map is used (no bundled dictionaries).
377
390
  *
378
- * Unlike the `"ko-kr"` Rust preset, JavaScript presets do **not**
379
- * automatically include a bundled dictionary. To use the *Standard Korean
380
- * Language Dictionary*, add `@gukhanmun/stdict-fst` or
381
- * `@gukhanmun/stdict-cdb` explicitly.
391
+ * JavaScript presets do **not**
392
+ * automatically include bundled dictionary data. To use the *Standard
393
+ * Korean Language Dictionary*, add `@gukhanmun/stdict-fst` or
394
+ * `@gukhanmun/stdict-cdb` explicitly. To use Open Korean Dictionary
395
+ * categories, add `@gukhanmun/opendict-fst` or
396
+ * `@gukhanmun/opendict-cdb` explicitly.
382
397
  *
383
398
  * @see {@link DictionarySource}
384
399
  */
package/dist/index.js CHANGED
@@ -208,6 +208,7 @@ function resolveOptions(opts = {}) {
208
208
  homophoneWindow: opts.homophoneWindow ?? (koKp ? "off" : "per-block"),
209
209
  homophoneDetection: opts.homophoneDetection ?? "context-local",
210
210
  firstOccurrenceWindow: opts.firstOccurrenceWindow ?? "off",
211
+ collapseRedundantParens: opts.collapseRedundantParens ?? true,
211
212
  recovery: opts.recovery ?? "strict"
212
213
  };
213
214
  }
@@ -252,6 +253,7 @@ function buildRawOptions(opts, resolved) {
252
253
  homophoneWindow: resolved.homophoneWindow,
253
254
  homophoneDetection: resolved.homophoneDetection,
254
255
  firstOccurrenceWindow: resolved.firstOccurrenceWindow,
256
+ collapseRedundantParens: resolved.collapseRedundantParens,
255
257
  recovery: resolved.recovery
256
258
  };
257
259
  if (resolved.rendering === "original" && opts.originalGloss != null) raw["originalGloss"] = opts.originalGloss;
@@ -50,4 +50,4 @@ binary further.
50
50
  License
51
51
  -------
52
52
 
53
- GPL-3.0-only. See `LICENSE` at the repository root.
53
+ GPL-3.0-only. See *LICENSE* at the repository root.
@@ -50,4 +50,4 @@ binary further.
50
50
  License
51
51
  -------
52
52
 
53
- GPL-3.0-only. See `LICENSE` at the repository root.
53
+ GPL-3.0-only. See *LICENSE* at the repository root.
@@ -4,7 +4,7 @@
4
4
  "Hong Minhe (洪 民憙) <hong@minhee.org>"
5
5
  ],
6
6
  "description": "WebAssembly binding for Gukhanmun via wasm-bindgen.",
7
- "version": "0.1.2",
7
+ "version": "0.2.0",
8
8
  "license": "GPL-3.0-only",
9
9
  "repository": {
10
10
  "type": "git",
@@ -50,4 +50,4 @@ binary further.
50
50
  License
51
51
  -------
52
52
 
53
- GPL-3.0-only. See `LICENSE` at the repository root.
53
+ GPL-3.0-only. See *LICENSE* at the repository root.
@@ -5,7 +5,7 @@
5
5
  "Hong Minhe (洪 民憙) <hong@minhee.org>"
6
6
  ],
7
7
  "description": "WebAssembly binding for Gukhanmun via wasm-bindgen.",
8
- "version": "0.1.2",
8
+ "version": "0.2.0",
9
9
  "license": "GPL-3.0-only",
10
10
  "repository": {
11
11
  "type": "git",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gukhanmun/wasm",
3
- "version": "0.1.2",
3
+ "version": "0.2.0-dev.119",
4
4
  "description": "WebAssembly implementation of the Gukhanmun hanja-to-hangul converter.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -45,7 +45,7 @@
45
45
  "@gukhanmun/types": "*"
46
46
  },
47
47
  "devDependencies": {
48
- "@gukhanmun/types": "0.1.2"
48
+ "@gukhanmun/types": "0.2.0-dev.119+50f854d"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "tsdown && node -e \"const fs=require('node:fs'),p=require('node:path');fs.cpSync('wasm','dist/wasm',{recursive:true,force:true,filter:(s)=>p.basename(s)!=='.gitignore'})\""