@gukhanmun/opendict-cdb 0.4.0-dev.235 → 0.4.0-dev.245
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/general.cdb.gz +0 -0
- package/dist/index.d.ts +15 -70
- package/dist/index.js +1 -2
- package/dist/north-korean.cdb.gz +0 -0
- package/package.json +2 -2
package/dist/general.cdb.gz
CHANGED
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -1,58 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Specifies a dictionary loaded from a binary file or URL.
|
|
5
|
-
*
|
|
6
|
-
* The `data` field accepts:
|
|
7
|
-
* - A `BufferSource` (`ArrayBuffer` or `ArrayBufferView`) — supported in all
|
|
8
|
-
* environments.
|
|
9
|
-
* - A `URL` — resolved via `fetch` in browsers; via `node:fs/promises`
|
|
10
|
-
* in Node.js, Deno 2.0+, and Bun.
|
|
11
|
-
* - A `string` — treated as a filesystem path; supported in Node.js,
|
|
12
|
-
* Deno 2.0+, and Bun only. Throws in browser environments.
|
|
13
|
-
*
|
|
14
|
-
* At runtime, a `FileDictionarySource` is distinguished from other values by
|
|
15
|
-
* the presence of a `format` property (`"format" in source`).
|
|
16
|
-
*/
|
|
17
|
-
interface FileDictionarySource {
|
|
18
|
-
/**
|
|
19
|
-
* The binary dictionary data or a reference to where it can be loaded.
|
|
20
|
-
*
|
|
21
|
-
* Pass a `BufferSource` for data already in memory, a `URL` for a remote
|
|
22
|
-
* or local URL (resolved via `fetch` or `readFile`), or a path `string`
|
|
23
|
-
* for filesystem paths (Node.js / Deno 2.0+ / Bun only).
|
|
24
|
-
*/
|
|
25
|
-
readonly data: ArrayBuffer | ArrayBufferView | URL | string;
|
|
26
|
-
/**
|
|
27
|
-
* The on-disk format of the dictionary file.
|
|
28
|
-
*
|
|
29
|
-
* - `"fst"` — Gukhanmun FST file (`*.gukfst`); preferred for small
|
|
30
|
-
* WebAssembly bundles. Supported in all runtimes.
|
|
31
|
-
* - `"cdb"` — Gukhanmun CDB-trie file (`*.gukcdb`); preferred when code
|
|
32
|
-
* auditability or trivial mmap support matters. Requires a filesystem
|
|
33
|
-
* or in-memory bytes; supported in Node-API and (with `from_bytes`) in
|
|
34
|
-
* WASM builds that include the `cdb` feature.
|
|
35
|
-
*
|
|
36
|
-
* The `"tsv"` format is reserved for future use; passing it throws
|
|
37
|
-
* `GukhanmunError` with code `"unsupported-content-type"`.
|
|
38
|
-
*/
|
|
39
|
-
readonly format: "fst" | "cdb";
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* A dictionary source accepted by {@link GukhanmunOptions.dictionaries}.
|
|
43
|
-
*
|
|
44
|
-
* Currently only {@link FileDictionarySource} (binary file / URL / path) is
|
|
45
|
-
* supported. Sources are tried in array order; the first match wins.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```ts
|
|
49
|
-
* import { stdictFst } from "@gukhanmun/stdict-fst";
|
|
50
|
-
* const g = await load({ dictionaries: [await stdictFst()] });
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region index.d.ts
|
|
55
|
-
|
|
1
|
+
import { FileDictionarySource, FileDictionarySource as FileDictionarySource$1 } from "@gukhanmun/types";
|
|
56
2
|
/**
|
|
57
3
|
* URL of the bundled Open Korean Dictionary 一般語 CDB binary.
|
|
58
4
|
*
|
|
@@ -60,25 +6,25 @@ interface FileDictionarySource {
|
|
|
60
6
|
* extension) to stay within registry per-file size limits;
|
|
61
7
|
* {@link opendictCdbBytes} inflates it transparently.
|
|
62
8
|
*/
|
|
63
|
-
declare const opendictGeneralCdbUrl: URL;
|
|
9
|
+
export declare const opendictGeneralCdbUrl: URL;
|
|
64
10
|
/**
|
|
65
11
|
* URL of the bundled Open Korean Dictionary 北韓語 CDB binary.
|
|
66
12
|
*
|
|
67
13
|
* Stored gzip-compressed; {@link opendictCdbBytes} inflates it transparently.
|
|
68
14
|
*/
|
|
69
|
-
declare const opendictNorthKoreanCdbUrl: URL;
|
|
15
|
+
export declare const opendictNorthKoreanCdbUrl: URL;
|
|
70
16
|
/**
|
|
71
17
|
* URL of the bundled Open Korean Dictionary 方言 CDB binary.
|
|
72
18
|
*
|
|
73
19
|
* Stored gzip-compressed; {@link opendictCdbBytes} inflates it transparently.
|
|
74
20
|
*/
|
|
75
|
-
declare const opendictDialectCdbUrl: URL;
|
|
21
|
+
export declare const opendictDialectCdbUrl: URL;
|
|
76
22
|
/**
|
|
77
23
|
* URL of the bundled Open Korean Dictionary 옛말 CDB binary.
|
|
78
24
|
*
|
|
79
25
|
* Stored gzip-compressed; {@link opendictCdbBytes} inflates it transparently.
|
|
80
26
|
*/
|
|
81
|
-
declare const opendictArchaicCdbUrl: URL;
|
|
27
|
+
export declare const opendictArchaicCdbUrl: URL;
|
|
82
28
|
/**
|
|
83
29
|
* Loads an Open Korean Dictionary CDB binary as raw bytes.
|
|
84
30
|
*
|
|
@@ -95,7 +41,7 @@ declare const opendictArchaicCdbUrl: URL;
|
|
|
95
41
|
* @param url Location of the CDB binary to read.
|
|
96
42
|
* @returns The CDB binary as a `Uint8Array`.
|
|
97
43
|
*/
|
|
98
|
-
declare function opendictCdbBytes(url: URL): Promise<Uint8Array>;
|
|
44
|
+
export declare function opendictCdbBytes(url: URL): Promise<Uint8Array>;
|
|
99
45
|
/**
|
|
100
46
|
* Loads the bundled Open Korean Dictionary 일반어 CDB binary as raw bytes.
|
|
101
47
|
*
|
|
@@ -103,7 +49,7 @@ declare function opendictCdbBytes(url: URL): Promise<Uint8Array>;
|
|
|
103
49
|
* {@link opendictGeneralCdbUrl}.
|
|
104
50
|
* @returns The CDB binary as a `Uint8Array`.
|
|
105
51
|
*/
|
|
106
|
-
declare function opendictGeneralCdbBytes(url?: URL): Promise<Uint8Array>;
|
|
52
|
+
export declare function opendictGeneralCdbBytes(url?: URL): Promise<Uint8Array>;
|
|
107
53
|
/**
|
|
108
54
|
* Loads the bundled Open Korean Dictionary 북한어 CDB binary as raw bytes.
|
|
109
55
|
*
|
|
@@ -111,7 +57,7 @@ declare function opendictGeneralCdbBytes(url?: URL): Promise<Uint8Array>;
|
|
|
111
57
|
* {@link opendictNorthKoreanCdbUrl}.
|
|
112
58
|
* @returns The CDB binary as a `Uint8Array`.
|
|
113
59
|
*/
|
|
114
|
-
declare function opendictNorthKoreanCdbBytes(url?: URL): Promise<Uint8Array>;
|
|
60
|
+
export declare function opendictNorthKoreanCdbBytes(url?: URL): Promise<Uint8Array>;
|
|
115
61
|
/**
|
|
116
62
|
* Loads the bundled Open Korean Dictionary 방언 CDB binary as raw bytes.
|
|
117
63
|
*
|
|
@@ -119,7 +65,7 @@ declare function opendictNorthKoreanCdbBytes(url?: URL): Promise<Uint8Array>;
|
|
|
119
65
|
* {@link opendictDialectCdbUrl}.
|
|
120
66
|
* @returns The CDB binary as a `Uint8Array`.
|
|
121
67
|
*/
|
|
122
|
-
declare function opendictDialectCdbBytes(url?: URL): Promise<Uint8Array>;
|
|
68
|
+
export declare function opendictDialectCdbBytes(url?: URL): Promise<Uint8Array>;
|
|
123
69
|
/**
|
|
124
70
|
* Loads the bundled Open Korean Dictionary 옛말 CDB binary as raw bytes.
|
|
125
71
|
*
|
|
@@ -127,30 +73,29 @@ declare function opendictDialectCdbBytes(url?: URL): Promise<Uint8Array>;
|
|
|
127
73
|
* {@link opendictArchaicCdbUrl}.
|
|
128
74
|
* @returns The CDB binary as a `Uint8Array`.
|
|
129
75
|
*/
|
|
130
|
-
declare function opendictArchaicCdbBytes(url?: URL): Promise<Uint8Array>;
|
|
76
|
+
export declare function opendictArchaicCdbBytes(url?: URL): Promise<Uint8Array>;
|
|
131
77
|
/**
|
|
132
78
|
* Loads the bundled Open Korean Dictionary 일반어 dictionary.
|
|
133
79
|
*
|
|
134
80
|
* @returns A `FileDictionarySource` with `format: "cdb"`.
|
|
135
81
|
*/
|
|
136
|
-
declare function opendictGeneralCdb(): Promise<FileDictionarySource>;
|
|
82
|
+
export declare function opendictGeneralCdb(): Promise<FileDictionarySource$1>;
|
|
137
83
|
/**
|
|
138
84
|
* Loads the bundled Open Korean Dictionary 북한어 dictionary.
|
|
139
85
|
*
|
|
140
86
|
* @returns A `FileDictionarySource` with `format: "cdb"`.
|
|
141
87
|
*/
|
|
142
|
-
declare function opendictNorthKoreanCdb(): Promise<FileDictionarySource>;
|
|
88
|
+
export declare function opendictNorthKoreanCdb(): Promise<FileDictionarySource$1>;
|
|
143
89
|
/**
|
|
144
90
|
* Loads the bundled Open Korean Dictionary 방언 dictionary.
|
|
145
91
|
*
|
|
146
92
|
* @returns A `FileDictionarySource` with `format: "cdb"`.
|
|
147
93
|
*/
|
|
148
|
-
declare function opendictDialectCdb(): Promise<FileDictionarySource>;
|
|
94
|
+
export declare function opendictDialectCdb(): Promise<FileDictionarySource$1>;
|
|
149
95
|
/**
|
|
150
96
|
* Loads the bundled Open Korean Dictionary 옛말 dictionary.
|
|
151
97
|
*
|
|
152
98
|
* @returns A `FileDictionarySource` with `format: "cdb"`.
|
|
153
99
|
*/
|
|
154
|
-
declare function opendictArchaicCdb(): Promise<FileDictionarySource>;
|
|
155
|
-
|
|
156
|
-
export { type FileDictionarySource, opendictArchaicCdb, opendictArchaicCdbBytes, opendictArchaicCdbUrl, opendictCdbBytes, opendictDialectCdb, opendictDialectCdbBytes, opendictDialectCdbUrl, opendictGeneralCdb, opendictGeneralCdbBytes, opendictGeneralCdbUrl, opendictNorthKoreanCdb, opendictNorthKoreanCdbBytes, opendictNorthKoreanCdbUrl };
|
|
100
|
+
export declare function opendictArchaicCdb(): Promise<FileDictionarySource$1>;
|
|
101
|
+
export type { FileDictionarySource };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// index.ts
|
|
2
2
|
/**
|
|
3
3
|
* URL of the bundled Open Korean Dictionary 一般語 CDB binary.
|
|
4
4
|
*
|
|
@@ -156,5 +156,4 @@ async function opendictArchaicCdb() {
|
|
|
156
156
|
format: "cdb"
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
//#endregion
|
|
160
159
|
export { opendictArchaicCdb, opendictArchaicCdbBytes, opendictArchaicCdbUrl, opendictCdbBytes, opendictDialectCdb, opendictDialectCdbBytes, opendictDialectCdbUrl, opendictGeneralCdb, opendictGeneralCdbBytes, opendictGeneralCdbUrl, opendictNorthKoreanCdb, opendictNorthKoreanCdbBytes, opendictNorthKoreanCdbUrl };
|
package/dist/north-korean.cdb.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gukhanmun/opendict-cdb",
|
|
3
|
-
"version": "0.4.0-dev.
|
|
3
|
+
"version": "0.4.0-dev.245",
|
|
4
4
|
"description": "Open Korean Dictionary categories bundled as CDB binaries for @gukhanmun/wasm and @gukhanmun/napi.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@gukhanmun/types": "*"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@gukhanmun/types": "0.4.0-dev.
|
|
64
|
+
"@gukhanmun/types": "0.4.0-dev.245+223a736"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"prebuild": "mise run -C ../.. opendict-cdb-data",
|