@gukhanmun/wasm 0.2.0-dev.96 → 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 +12 -6
- package/dist/index.js +2 -0
- package/dist/wasm/deno/gukhanmun_wasm_bg.wasm +0 -0
- package/dist/wasm/nodejs/gukhanmun_wasm_bg.wasm +0 -0
- package/dist/wasm/nodejs/package.json +1 -1
- package/dist/wasm/web/gukhanmun_wasm_bg.wasm +0 -0
- package/dist/wasm/web/package.json +1 -1
- package/package.json +2 -2
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
|
*
|
|
@@ -100,11 +102,13 @@ type Segmentation = "lattice" | "eager";
|
|
|
100
102
|
* (`十百千萬億兆京`) using stack-based accumulation and produce Arabic,
|
|
101
103
|
* respecting the Korean convention that bare `十` means 10 not `一十`.
|
|
102
104
|
* Corresponds to Rust `NumeralStrategy::AdditiveArabic`.
|
|
103
|
-
* - `"smart"` — Uses `"additive-arabic"`
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
105
|
+
* - `"smart"` — Uses `"additive-arabic"` for additive numerals that
|
|
106
|
+
* begin with a digit, and for small-place-marker starts (`十`, `百`,
|
|
107
|
+
* `千`) unless the next character is an ambiguous non-unit hanja word
|
|
108
|
+
* character; uses `"positional-arabic"` for pure-digit runs of four or
|
|
109
|
+
* more characters (year convention) or when a unit hanja follows the
|
|
110
|
+
* digit run (`年月日時分秒號世紀` and others); otherwise falls back to
|
|
111
|
+
* `"hangul-phonetic"`. Corresponds to Rust `NumeralStrategy::Smart`.
|
|
108
112
|
*/
|
|
109
113
|
type NumeralStrategy = "hangul-phonetic" | "positional-arabic" | "additive-arabic" | "smart";
|
|
110
114
|
/**
|
|
@@ -313,6 +317,8 @@ interface GukhanmunOptions {
|
|
|
313
317
|
* @see {@link OriginalGloss}
|
|
314
318
|
*/
|
|
315
319
|
readonly originalGloss?: OriginalGloss;
|
|
320
|
+
/** The hanja variant set. Defaults to `"as-dictionary"`. */
|
|
321
|
+
readonly hanjaVariantSet?: HanjaVariantSet;
|
|
316
322
|
/**
|
|
317
323
|
* Hanja-span segmentation algorithm. Defaults to `"lattice"`.
|
|
318
324
|
*
|
|
@@ -609,4 +615,4 @@ declare class GukhanmunError extends Error {
|
|
|
609
615
|
*/
|
|
610
616
|
declare function load(options?: GukhanmunOptions): Promise<Gukhanmun>;
|
|
611
617
|
//#endregion
|
|
612
|
-
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 };
|
|
618
|
+
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
|
@@ -202,6 +202,7 @@ function resolveOptions(opts = {}) {
|
|
|
202
202
|
return {
|
|
203
203
|
preset,
|
|
204
204
|
rendering: opts.rendering ?? "hangul-only",
|
|
205
|
+
hanjaVariantSet: opts.hanjaVariantSet ?? "as-dictionary",
|
|
205
206
|
segmentation: opts.segmentation ?? "lattice",
|
|
206
207
|
numerals: opts.numerals ?? "hangul-phonetic",
|
|
207
208
|
initialSoundLaw: opts.initialSoundLaw ?? (koKp ? false : true),
|
|
@@ -247,6 +248,7 @@ function buildRawOptions(opts, resolved) {
|
|
|
247
248
|
const raw = {
|
|
248
249
|
preset: resolved.preset,
|
|
249
250
|
rendering: resolved.rendering,
|
|
251
|
+
hanjaVariantSet: resolved.hanjaVariantSet,
|
|
250
252
|
segmentation: resolved.segmentation,
|
|
251
253
|
numerals: resolved.numerals,
|
|
252
254
|
initialSoundLaw: resolved.initialSoundLaw,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gukhanmun/wasm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-dev.153",
|
|
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.
|
|
48
|
+
"@gukhanmun/types": "0.3.0-dev.153+e988fed"
|
|
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'})\""
|