@gukhanmun/wasm 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 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
  *
@@ -611,4 +615,4 @@ declare class GukhanmunError extends Error {
611
615
  */
612
616
  declare function load(options?: GukhanmunOptions): Promise<Gukhanmun>;
613
617
  //#endregion
614
- 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,
@@ -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.2.0",
7
+ "version": "0.3.0",
8
8
  "license": "GPL-3.0-only",
9
9
  "repository": {
10
10
  "type": "git",
@@ -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.2.0",
8
+ "version": "0.3.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.2.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.2.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'})\""