@gukhanmun/stdict-fst 0.1.0-dev.0 → 0.1.0-dev.11

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.
Files changed (2) hide show
  1. package/README.md +50 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ @gukhanmun/stdict-fst
2
+ =====================
3
+
4
+ Standard Korean Language Dictionary (표준국어대사전, 標準國語大辭典) compiled
5
+ into a Gukhanmun FST binary and distributed as an npm package. Use this with
6
+ `@gukhanmun/wasm` or `@gukhanmun/napi` when `ko-KR` readings are needed.
7
+
8
+
9
+ Installation
10
+ ------------
11
+
12
+ ~~~~ sh
13
+ npm install @gukhanmun/stdict-fst
14
+ ~~~~
15
+
16
+
17
+ Usage
18
+ -----
19
+
20
+ ~~~~ ts
21
+ import { load } from "@gukhanmun/wasm";
22
+ import { stdictFst } from "@gukhanmun/stdict-fst";
23
+
24
+ const g = await load({ dictionaries: [await stdictFst()] });
25
+ console.log(g.convert("漢字를 한글로")); // "한자를 한글로"
26
+ ~~~~
27
+
28
+ `stdictFst()` returns a `DictionarySource` record (a
29
+ `{ format: "fst", bytes: Uint8Array }` object). `stdictFstBytes()` returns only
30
+ the `Uint8Array` when you need the raw bytes. `stdictFstUrl` is the URL of the
31
+ binary inside the package, useful for preloading or caching.
32
+
33
+ On Node.js the bytes are read with `node:fs/promises`. On all other runtimes
34
+ they are fetched with `fetch`.
35
+
36
+
37
+ Relation to `@gukhanmun/stdict-cdb`
38
+ -----------------------------------
39
+
40
+ Both packages contain the same dictionary data in different binary formats. The
41
+ FST format supports prefix streaming and is the better choice for
42
+ `@gukhanmun/wasm` workloads with the lattice segmenter. The CDB format has O(1)
43
+ lookup and a simpler layout. Either works; choose based on your performance
44
+ profile or integration constraints.
45
+
46
+
47
+ License
48
+ -------
49
+
50
+ GPL-3.0-only.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gukhanmun/stdict-fst",
3
- "version": "0.1.0-dev.0",
3
+ "version": "0.1.0-dev.11",
4
4
  "description": "Standard Korean Language Dictionary bundled as an FST binary for @gukhanmun/wasm and @gukhanmun/napi.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -46,7 +46,7 @@
46
46
  "@gukhanmun/types": "*"
47
47
  },
48
48
  "devDependencies": {
49
- "@gukhanmun/types": "0.1.0-dev.0"
49
+ "@gukhanmun/types": "0.1.0-dev.11+a4f62826f422ceaa9ade163304ea2f756b1dfe54"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "tsdown && node -e \"require('node:fs').copyFileSync('stdict.fst','dist/stdict.fst')\""