@gukhanmun/napi 0.2.0-dev.42 → 0.2.0-dev.59
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 +13 -0
- package/dist/index.js +2 -0
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -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.
|
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.2.0-dev.
|
|
3
|
+
"version": "0.2.0-dev.59",
|
|
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.2.0-dev.
|
|
18
|
-
"@gukhanmun/napi-x86_64-apple-darwin": "0.2.0-dev.
|
|
19
|
-
"@gukhanmun/napi-x86_64-pc-windows-msvc": "0.2.0-dev.
|
|
20
|
-
"@gukhanmun/napi-aarch64-
|
|
21
|
-
"@gukhanmun/napi-aarch64-
|
|
22
|
-
"@gukhanmun/napi-x86_64-unknown-linux-gnu": "0.2.0-dev.
|
|
17
|
+
"@gukhanmun/napi-aarch64-apple-darwin": "0.2.0-dev.59+4dabd6074014de7775a4080848fd6b2e69282d63",
|
|
18
|
+
"@gukhanmun/napi-x86_64-apple-darwin": "0.2.0-dev.59+4dabd6074014de7775a4080848fd6b2e69282d63",
|
|
19
|
+
"@gukhanmun/napi-x86_64-pc-windows-msvc": "0.2.0-dev.59+4dabd6074014de7775a4080848fd6b2e69282d63",
|
|
20
|
+
"@gukhanmun/napi-aarch64-unknown-linux-gnu": "0.2.0-dev.59+4dabd6074014de7775a4080848fd6b2e69282d63",
|
|
21
|
+
"@gukhanmun/napi-aarch64-pc-windows-msvc": "0.2.0-dev.59+4dabd6074014de7775a4080848fd6b2e69282d63",
|
|
22
|
+
"@gukhanmun/napi-x86_64-unknown-linux-gnu": "0.2.0-dev.59+4dabd6074014de7775a4080848fd6b2e69282d63"
|
|
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.2.0-dev.
|
|
55
|
+
"@gukhanmun/types": "0.2.0-dev.59+4dabd6074014de7775a4080848fd6b2e69282d63"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsdown"
|