@gukhanmun/opendict-fst 0.2.0-dev.0 → 0.2.0-dev.119

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/ATTRIBUTION.md CHANGED
@@ -1,8 +1,8 @@
1
1
  OpenDict FST package license and attribution
2
2
  ============================================
3
3
 
4
- This package contains Gukhanmun package code and bundled Open Korean Dictionary
5
- (우리말샘) FST data.
4
+ This package contains Gukhanmun package code and bundled *Open Korean
5
+ Dictionary* (우리말샘) FST data.
6
6
 
7
7
 
8
8
  Code license
@@ -15,14 +15,14 @@ repository root *LICENSE* file for the full license text.
15
15
  Data attribution
16
16
  ----------------
17
17
 
18
- The bundled dictionary data is derived from the Open Korean Dictionary
18
+ The bundled dictionary data is derived from the *Open Korean Dictionary*
19
19
  (우리말샘) JSON dump published by the National Institute of Korean Language.
20
20
 
21
- - Source: National Institute of Korean Language, Open Korean Dictionary
21
+ - Source: National Institute of Korean Language, *Open Korean Dictionary*
22
22
  (우리말샘), <https://opendict.korean.go.kr/>
23
23
  - Snapshot: *전체 내려받기\_우리말샘\_json\_20260503.zip*
24
24
  - Data license: Creative Commons Attribution-ShareAlike 2.0 Korea
25
25
  (CC BY-SA 2.0 KR), <https://creativecommons.org/licenses/by-sa/2.0/kr/>
26
26
 
27
27
  The generated FST files in this package are modified dictionary snapshots
28
- produced by Gukhanmun's Open Korean Dictionary extractor.
28
+ produced by Gukhanmun's *Open Korean Dictionary* extractor.
package/README.md CHANGED
@@ -5,8 +5,8 @@
5
5
  [![npm][npm badge]][npm]
6
6
  [![License: GPL-3.0-or-later AND CC BY-SA 2.0 KR][license badge]][GPL]
7
7
 
8
- Open Korean Dictionary (우리말샘) categories bundled as FST binaries for
9
- `@gukhanmun/wasm` and `@gukhanmun/napi`.
8
+ *Open Korean Dictionary* (우리말샘) categories compiled into FST binaries for
9
+ use with `@gukhanmun/wasm` or `@gukhanmun/napi`.
10
10
 
11
11
  [JSR badge]: https://jsr.io/badges/@gukhanmun/opendict-fst
12
12
  [JSR]: https://jsr.io/@gukhanmun/opendict-fst
@@ -16,6 +16,18 @@ Open Korean Dictionary (우리말샘) categories bundled as FST binaries for
16
16
  [GPL]: https://www.gnu.org/licenses/gpl-3.0.html
17
17
 
18
18
 
19
+ Installation
20
+ ------------
21
+
22
+ ~~~~ bash
23
+ npm add @gukhanmun/opendict-fst
24
+ pnpm add @gukhanmun/opendict-fst
25
+ yarn add @gukhanmun/opendict-fst
26
+ bun add @gukhanmun/opendict-fst
27
+ deno add jsr:@gukhanmun/opendict-fst
28
+ ~~~~
29
+
30
+
19
31
  Usage
20
32
  -----
21
33
 
@@ -27,18 +39,55 @@ const g = await load({
27
39
  preset: "ko-kp",
28
40
  dictionaries: [await opendictNorthKoreanFst()],
29
41
  });
30
- console.log(g.convert("歷史와 來日"));
42
+ console.log(g.convert("歷史와 來日")); // "력사와 래일"
31
43
  ~~~~
32
44
 
33
- The package exports separate helpers for the 일반어, 북한어, 방언, and 옛말
34
- categories so applications can choose only the dictionaries they need.
45
+ The package exports separate helper functions for the 一般語, 北韓語, 方言,
46
+ and 옛말 categories, so you can select and load only the categories you need:
47
+
48
+ - `opendictGeneralFst()`
49
+ - `opendictNorthKoreanFst()`
50
+ - `opendictDialectFst()`
51
+ - `opendictArchaicFst()`
52
+
53
+ Each function returns a `DictionarySource` record (a `{ format: "fst", bytes: Uint8Array }`
54
+ object).
55
+
56
+ ### Raw bytes and URLs
57
+
58
+ If you only need raw `Uint8Array` bytes, use the `*Bytes()` helpers:
59
+
60
+ - `opendictGeneralFstBytes()`
61
+ - `opendictNorthKoreanFstBytes()`
62
+ - `opendictDialectFstBytes()`
63
+ - `opendictArchaicFstBytes()`
64
+
65
+ To get the package URL of an FST binary, use the `*Url` constants:
66
+
67
+ - `opendictGeneralFstUrl`
68
+ - `opendictNorthKoreanFstUrl`
69
+ - `opendictDialectFstUrl`
70
+ - `opendictArchaicFstUrl`
71
+
72
+ The `*Bytes()` helpers read the binary from disk using `node:fs/promises` if loaded from
73
+ a `file:` URL (default for npm installations), and fall back to `fetch` for other protocols.
74
+
75
+
76
+ Relation to `@gukhanmun/opendict-cdb`
77
+ -------------------------------------
78
+
79
+ Both packages contain the same dictionary data in different binary formats. The
80
+ FST format supports prefix streaming and is the better choice for
81
+ `@gukhanmun/wasm` workloads with the lattice segmenter. The CDB format has O(1)
82
+ lookup and a simpler layout. Either works; choose based on your performance
83
+ profile or integration constraints.
35
84
 
36
85
 
37
86
  Data attribution
38
87
  ----------------
39
88
 
40
- The bundled dictionary data is extracted from the National Institute of Korean
41
- Language's Open Korean Dictionary (우리말샘) JSON dump dated 2026-05-03. See
89
+ The bundled dictionary data is derived from the National Institute of Korean
90
+ Language's *Open Korean Dictionary* (우리말샘) JSON dump dated 2026-05-03. See
42
91
  *ATTRIBUTION.md* for source and license details.
43
92
 
44
93
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gukhanmun/opendict-fst",
3
- "version": "0.2.0-dev.0",
3
+ "version": "0.2.0-dev.119",
4
4
  "description": "Open Korean Dictionary categories bundled as FST binaries for @gukhanmun/wasm and @gukhanmun/napi.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -52,7 +52,7 @@
52
52
  "@gukhanmun/types": "*"
53
53
  },
54
54
  "devDependencies": {
55
- "@gukhanmun/types": "0.2.0-dev.0"
55
+ "@gukhanmun/types": "0.2.0-dev.119+50f854d"
56
56
  },
57
57
  "scripts": {
58
58
  "prebuild": "mise run -C ../.. opendict-fst-data",