garu-ko 0.4.1 → 0.5.0
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "garu-ko",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Ultra-lightweight Korean morphological analyzer for the web (1.
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Ultra-lightweight Korean morphological analyzer for the web (1.7MB model, WASM, F1 93.7%)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
package/pkg/garu_wasm.d.ts
CHANGED
|
@@ -6,11 +6,7 @@ export class GaruWasm {
|
|
|
6
6
|
[Symbol.dispose](): void;
|
|
7
7
|
analyze(text: string): any;
|
|
8
8
|
analyze_topn(text: string, n: number): any;
|
|
9
|
-
|
|
10
|
-
* Load CNN reranker model.
|
|
11
|
-
*/
|
|
12
|
-
load_cnn(cnn_data: Uint8Array): void;
|
|
13
|
-
constructor(model_data: Uint8Array);
|
|
9
|
+
constructor(model_data: Uint8Array, cnn_data: Uint8Array);
|
|
14
10
|
tokenize(text: string): any;
|
|
15
11
|
static version(): string;
|
|
16
12
|
}
|
|
@@ -22,8 +18,7 @@ export interface InitOutput {
|
|
|
22
18
|
readonly __wbg_garuwasm_free: (a: number, b: number) => void;
|
|
23
19
|
readonly garuwasm_analyze: (a: number, b: number, c: number) => [number, number, number];
|
|
24
20
|
readonly garuwasm_analyze_topn: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
25
|
-
readonly
|
|
26
|
-
readonly garuwasm_new: (a: number, b: number) => [number, number, number];
|
|
21
|
+
readonly garuwasm_new: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
27
22
|
readonly garuwasm_tokenize: (a: number, b: number, c: number) => [number, number, number];
|
|
28
23
|
readonly garuwasm_version: () => [number, number];
|
|
29
24
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
package/pkg/garu_wasm.js
CHANGED
|
@@ -38,25 +38,16 @@ export class GaruWasm {
|
|
|
38
38
|
}
|
|
39
39
|
return takeFromExternrefTable0(ret[0]);
|
|
40
40
|
}
|
|
41
|
-
/**
|
|
42
|
-
* Load CNN reranker model.
|
|
43
|
-
* @param {Uint8Array} cnn_data
|
|
44
|
-
*/
|
|
45
|
-
load_cnn(cnn_data) {
|
|
46
|
-
const ptr0 = passArray8ToWasm0(cnn_data, wasm.__wbindgen_malloc);
|
|
47
|
-
const len0 = WASM_VECTOR_LEN;
|
|
48
|
-
const ret = wasm.garuwasm_load_cnn(this.__wbg_ptr, ptr0, len0);
|
|
49
|
-
if (ret[1]) {
|
|
50
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
41
|
/**
|
|
54
42
|
* @param {Uint8Array} model_data
|
|
43
|
+
* @param {Uint8Array} cnn_data
|
|
55
44
|
*/
|
|
56
|
-
constructor(model_data) {
|
|
45
|
+
constructor(model_data, cnn_data) {
|
|
57
46
|
const ptr0 = passArray8ToWasm0(model_data, wasm.__wbindgen_malloc);
|
|
58
47
|
const len0 = WASM_VECTOR_LEN;
|
|
59
|
-
const
|
|
48
|
+
const ptr1 = passArray8ToWasm0(cnn_data, wasm.__wbindgen_malloc);
|
|
49
|
+
const len1 = WASM_VECTOR_LEN;
|
|
50
|
+
const ret = wasm.garuwasm_new(ptr0, len0, ptr1, len1);
|
|
60
51
|
if (ret[2]) {
|
|
61
52
|
throw takeFromExternrefTable0(ret[1]);
|
|
62
53
|
}
|
|
@@ -94,7 +85,7 @@ export class GaruWasm {
|
|
|
94
85
|
}
|
|
95
86
|
}
|
|
96
87
|
if (Symbol.dispose) GaruWasm.prototype[Symbol.dispose] = GaruWasm.prototype.free;
|
|
97
|
-
import * as import1 from "./snippets/garu-core-
|
|
88
|
+
import * as import1 from "./snippets/garu-core-56e20afd30dd714b/inline0.js"
|
|
98
89
|
|
|
99
90
|
function __wbg_get_imports() {
|
|
100
91
|
const import0 = {
|
|
@@ -155,7 +146,7 @@ function __wbg_get_imports() {
|
|
|
155
146
|
return {
|
|
156
147
|
__proto__: null,
|
|
157
148
|
"./garu_wasm_bg.js": import0,
|
|
158
|
-
"./snippets/garu-core-
|
|
149
|
+
"./snippets/garu-core-56e20afd30dd714b/inline0.js": import1,
|
|
159
150
|
};
|
|
160
151
|
}
|
|
161
152
|
|
package/pkg/garu_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -4,8 +4,7 @@ export const memory: WebAssembly.Memory;
|
|
|
4
4
|
export const __wbg_garuwasm_free: (a: number, b: number) => void;
|
|
5
5
|
export const garuwasm_analyze: (a: number, b: number, c: number) => [number, number, number];
|
|
6
6
|
export const garuwasm_analyze_topn: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
7
|
-
export const
|
|
8
|
-
export const garuwasm_new: (a: number, b: number) => [number, number, number];
|
|
7
|
+
export const garuwasm_new: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
9
8
|
export const garuwasm_tokenize: (a: number, b: number, c: number) => [number, number, number];
|
|
10
9
|
export const garuwasm_version: () => [number, number];
|
|
11
10
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
package/pkg/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function performance_now() { return performance.now(); }
|