@gukhanmun/stdict-fst 0.3.1 → 0.4.0-dev.236
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 +24 -7
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
* Deno 2.0+, and Bun only. Throws in browser environments.
|
|
13
13
|
*
|
|
14
14
|
* At runtime, a `FileDictionarySource` is distinguished from other values by
|
|
15
|
-
* the
|
|
15
|
+
* the absence of an `entries` property (`"entries" in source` selects a
|
|
16
|
+
* {@link MapDictionarySource}).
|
|
16
17
|
*/
|
|
17
18
|
interface FileDictionarySource {
|
|
18
19
|
/**
|
|
@@ -33,21 +34,37 @@ interface FileDictionarySource {
|
|
|
33
34
|
* or in-memory bytes; supported in Node-API and (with `from_bytes`) in
|
|
34
35
|
* WASM builds that include the `cdb` feature.
|
|
35
36
|
*
|
|
36
|
-
* The `"tsv"` format is reserved
|
|
37
|
-
*
|
|
37
|
+
* The `"tsv"` format is reserved and never accepted. Pass entries in memory
|
|
38
|
+
* through {@link MapDictionarySource} instead of compiling a table.
|
|
38
39
|
*/
|
|
39
40
|
readonly format: "fst" | "cdb";
|
|
40
41
|
}
|
|
41
42
|
/**
|
|
42
|
-
* A dictionary
|
|
43
|
+
* A dictionary built from entries computed at runtime, such as per-document
|
|
44
|
+
* reading overrides.
|
|
43
45
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
+
* Use this instead of compiling a TSV file with `gukhanmun-mkdict` when the
|
|
47
|
+
* entries do not exist on disk, for example in a browser, an edge runtime, or a
|
|
48
|
+
* site generator that derives entries per document.
|
|
49
|
+
*
|
|
50
|
+
* A source is distinguished from a {@link FileDictionarySource} by the presence
|
|
51
|
+
* of an `entries` property.
|
|
46
52
|
*
|
|
47
53
|
* @example
|
|
48
54
|
* ```ts
|
|
49
55
|
* import { stdictFst } from "@gukhanmun/stdict-fst";
|
|
50
|
-
* const g = await load({
|
|
56
|
+
* const g = await load({
|
|
57
|
+
* dictionaries: [
|
|
58
|
+
* {
|
|
59
|
+
* entries: [
|
|
60
|
+
* { hanja: "高橋", reading: "다카하시" },
|
|
61
|
+
* { hanja: "東京", reading: "도쿄", preference: 10 },
|
|
62
|
+
* { hanja: "年代", reading: "연대", suffixReading: "년대" },
|
|
63
|
+
* ],
|
|
64
|
+
* },
|
|
65
|
+
* await stdictFst(),
|
|
66
|
+
* ],
|
|
67
|
+
* });
|
|
51
68
|
* ```
|
|
52
69
|
*/
|
|
53
70
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gukhanmun/stdict-fst",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0-dev.236",
|
|
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": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@gukhanmun/types": "*"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@gukhanmun/types": "0.
|
|
58
|
+
"@gukhanmun/types": "0.4.0-dev.236+75afc34"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "tsdown && node -e \"require('node:fs').copyFileSync('stdict.fst','dist/stdict.fst')\""
|