@gukhanmun/napi 0.2.0 → 0.3.0-dev.153
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 +5 -1
- package/dist/index.js +2 -0
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ type Preset = "ko-kr" | "ko-kp";
|
|
|
51
51
|
* `RenderMode::Original`.
|
|
52
52
|
*/
|
|
53
53
|
type RenderMode = "hangul-only" | "hangul-hanja-parens" | "hanja-hangul-parens" | "ruby-on-hangul" | "ruby-on-hanja" | "original";
|
|
54
|
+
/** The hanja variant set applied after dictionary recognition. */
|
|
55
|
+
type HanjaVariantSet = "as-dictionary" | "shinjitai" | "kanxi" | "simplified" | "asahimoji";
|
|
54
56
|
/**
|
|
55
57
|
* Selects how glosses are rendered when {@link RenderMode} is `"original"`.
|
|
56
58
|
*
|
|
@@ -315,6 +317,8 @@ interface GukhanmunOptions {
|
|
|
315
317
|
* @see {@link OriginalGloss}
|
|
316
318
|
*/
|
|
317
319
|
readonly originalGloss?: OriginalGloss;
|
|
320
|
+
/** The hanja variant set. Defaults to `"as-dictionary"`. */
|
|
321
|
+
readonly hanjaVariantSet?: HanjaVariantSet;
|
|
318
322
|
/**
|
|
319
323
|
* Hanja-span segmentation algorithm. Defaults to `"lattice"`.
|
|
320
324
|
*
|
|
@@ -610,4 +614,4 @@ declare class GukhanmunError extends Error {
|
|
|
610
614
|
*/
|
|
611
615
|
declare function load(options?: GukhanmunOptions): Promise<Gukhanmun>;
|
|
612
616
|
//#endregion
|
|
613
|
-
export { type ContextWindow, type DictionaryEntry, type DictionarySource, type Directives, type ErrorCode, type FileDictionarySource, type Format, type Gukhanmun, GukhanmunError, type GukhanmunFactory, type GukhanmunOptions, type HomophoneDetection, type HtmlOptions, type NumeralStrategy, type OriginalGloss, type Preset, type Recovery, type RenderMode, type Segmentation, load };
|
|
617
|
+
export { type ContextWindow, type DictionaryEntry, type DictionarySource, type Directives, type ErrorCode, type FileDictionarySource, type Format, type Gukhanmun, GukhanmunError, type GukhanmunFactory, type GukhanmunOptions, type HanjaVariantSet, type HomophoneDetection, type HtmlOptions, type NumeralStrategy, type OriginalGloss, type Preset, type Recovery, type RenderMode, type Segmentation, load };
|
package/dist/index.js
CHANGED
|
@@ -153,6 +153,7 @@ function resolveOptions(opts = {}) {
|
|
|
153
153
|
return {
|
|
154
154
|
preset,
|
|
155
155
|
rendering: opts.rendering ?? "hangul-only",
|
|
156
|
+
hanjaVariantSet: opts.hanjaVariantSet ?? "as-dictionary",
|
|
156
157
|
segmentation: opts.segmentation ?? "lattice",
|
|
157
158
|
numerals: opts.numerals ?? "hangul-phonetic",
|
|
158
159
|
initialSoundLaw: opts.initialSoundLaw ?? (koKp ? false : true),
|
|
@@ -167,6 +168,7 @@ function buildRawOptions(opts, resolved) {
|
|
|
167
168
|
const raw = {
|
|
168
169
|
preset: resolved.preset,
|
|
169
170
|
rendering: resolved.rendering,
|
|
171
|
+
hanjaVariantSet: resolved.hanjaVariantSet,
|
|
170
172
|
segmentation: resolved.segmentation,
|
|
171
173
|
numerals: resolved.numerals,
|
|
172
174
|
initialSoundLaw: resolved.initialSoundLaw,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gukhanmun/napi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-dev.153",
|
|
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-x86_64-apple-darwin": "0.
|
|
19
|
-
"@gukhanmun/napi-
|
|
20
|
-
"@gukhanmun/napi-
|
|
21
|
-
"@gukhanmun/napi-
|
|
22
|
-
"@gukhanmun/napi-
|
|
17
|
+
"@gukhanmun/napi-aarch64-apple-darwin": "0.3.0-dev.153+e988fed",
|
|
18
|
+
"@gukhanmun/napi-x86_64-apple-darwin": "0.3.0-dev.153+e988fed",
|
|
19
|
+
"@gukhanmun/napi-x86_64-pc-windows-msvc": "0.3.0-dev.153+e988fed",
|
|
20
|
+
"@gukhanmun/napi-aarch64-unknown-linux-gnu": "0.3.0-dev.153+e988fed",
|
|
21
|
+
"@gukhanmun/napi-x86_64-unknown-linux-gnu": "0.3.0-dev.153+e988fed",
|
|
22
|
+
"@gukhanmun/napi-aarch64-pc-windows-msvc": "0.3.0-dev.153+e988fed"
|
|
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.3.0-dev.153+e988fed"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsdown"
|