@gukhanmun/napi 0.1.2 → 0.2.0-dev.115
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 +21 -6
- package/dist/index.js +2 -0
- package/package.json +8 -8
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
|
|
389
|
+
* fallback Unihan character map is used (no bundled dictionaries).
|
|
377
390
|
*
|
|
378
|
-
*
|
|
379
|
-
* automatically include
|
|
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
|
@@ -159,6 +159,7 @@ function resolveOptions(opts = {}) {
|
|
|
159
159
|
homophoneWindow: opts.homophoneWindow ?? (koKp ? "off" : "per-block"),
|
|
160
160
|
homophoneDetection: opts.homophoneDetection ?? "context-local",
|
|
161
161
|
firstOccurrenceWindow: opts.firstOccurrenceWindow ?? "off",
|
|
162
|
+
collapseRedundantParens: opts.collapseRedundantParens ?? true,
|
|
162
163
|
recovery: opts.recovery ?? "strict"
|
|
163
164
|
};
|
|
164
165
|
}
|
|
@@ -172,6 +173,7 @@ function buildRawOptions(opts, resolved) {
|
|
|
172
173
|
homophoneWindow: resolved.homophoneWindow,
|
|
173
174
|
homophoneDetection: resolved.homophoneDetection,
|
|
174
175
|
firstOccurrenceWindow: resolved.firstOccurrenceWindow,
|
|
176
|
+
collapseRedundantParens: resolved.collapseRedundantParens,
|
|
175
177
|
recovery: resolved.recovery
|
|
176
178
|
};
|
|
177
179
|
if (resolved.rendering === "original" && opts.originalGloss != null) raw["originalGloss"] = opts.originalGloss;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gukhanmun/napi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-dev.115",
|
|
4
4
|
"description": "Node.js native addon (napi-rs) for the Gukhanmun hanja-to-hangul converter.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"dist"
|
|
15
15
|
],
|
|
16
16
|
"optionalDependencies": {
|
|
17
|
-
"@gukhanmun/napi-aarch64-apple-darwin": "0.
|
|
18
|
-
"@gukhanmun/napi-
|
|
19
|
-
"@gukhanmun/napi-aarch64-
|
|
20
|
-
"@gukhanmun/napi-x86_64-pc-windows-msvc": "0.
|
|
21
|
-
"@gukhanmun/napi-
|
|
22
|
-
"@gukhanmun/napi-x86_64-
|
|
17
|
+
"@gukhanmun/napi-aarch64-apple-darwin": "0.2.0-dev.115+7e9dc967239aee2ac70b52d2149d745fa2a18545",
|
|
18
|
+
"@gukhanmun/napi-x86_64-apple-darwin": "0.2.0-dev.115+7e9dc967239aee2ac70b52d2149d745fa2a18545",
|
|
19
|
+
"@gukhanmun/napi-aarch64-pc-windows-msvc": "0.2.0-dev.115+7e9dc967239aee2ac70b52d2149d745fa2a18545",
|
|
20
|
+
"@gukhanmun/napi-x86_64-pc-windows-msvc": "0.2.0-dev.115+7e9dc967239aee2ac70b52d2149d745fa2a18545",
|
|
21
|
+
"@gukhanmun/napi-aarch64-unknown-linux-gnu": "0.2.0-dev.115+7e9dc967239aee2ac70b52d2149d745fa2a18545",
|
|
22
|
+
"@gukhanmun/napi-x86_64-unknown-linux-gnu": "0.2.0-dev.115+7e9dc967239aee2ac70b52d2149d745fa2a18545"
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://github.com/dahlia/gukhanmun",
|
|
25
25
|
"bugs": "https://github.com/dahlia/gukhanmun/issues",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@gukhanmun/types": "*"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@gukhanmun/types": "0.
|
|
55
|
+
"@gukhanmun/types": "0.2.0-dev.115+7e9dc967239aee2ac70b52d2149d745fa2a18545"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsdown"
|