lindera-wasm-ipadic-web 2.1.1
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/LICENSE +21 -0
- package/README.md +140 -0
- package/lindera_wasm.d.ts +409 -0
- package/lindera_wasm.js +1922 -0
- package/lindera_wasm_bg.wasm +0 -0
- package/package.json +29 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 by the project authors.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# lindera-wasm
|
|
2
|
+
|
|
3
|
+
WebAssembly of Lindera
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Demo Application
|
|
8
|
+
|
|
9
|
+
- <https://lindera.github.io/lindera-wasm/>
|
|
10
|
+
|
|
11
|
+
## npm
|
|
12
|
+
|
|
13
|
+
### Web
|
|
14
|
+
|
|
15
|
+
- <https://www.npmjs.com/package/lindera-wasm-web-cjk>
|
|
16
|
+
Lindera WASM with CJK dictionaries (IPADIC, ko-dic, CC-CEDICT) for Web
|
|
17
|
+
|
|
18
|
+
- <https://www.npmjs.com/package/lindera-wasm-web-ipadic>
|
|
19
|
+
Lindera WASM with Japanese dictionary (IPADIC) for Web
|
|
20
|
+
|
|
21
|
+
- <https://www.npmjs.com/package/lindera-wasm-web-unidic>
|
|
22
|
+
Lindera WASM with Japanese dictionary (UniDic) for Web
|
|
23
|
+
|
|
24
|
+
- <https://www.npmjs.com/package/lindera-wasm-web-ko-dic>
|
|
25
|
+
Lindera WASM with Korean dictionary (ko-dic) for Web
|
|
26
|
+
|
|
27
|
+
- <https://www.npmjs.com/package/lindera-wasm-web-cc-cedict>
|
|
28
|
+
Lindera WASM with Chinese dictionary (CC-CEDICT) for Web
|
|
29
|
+
|
|
30
|
+
### Node.js
|
|
31
|
+
|
|
32
|
+
- <https://www.npmjs.com/package/lindera-wasm-nodejs-cjk>
|
|
33
|
+
Lindera WASM with CJK dictionaries (IPADIC, ko-dic, CC-CEDICT) for Node.js
|
|
34
|
+
|
|
35
|
+
- <https://www.npmjs.com/package/lindera-wasm-nodejs-ipadic>
|
|
36
|
+
Lindera WASM with Japanese dictionary (IPADIC) for Node.js
|
|
37
|
+
|
|
38
|
+
- <https://www.npmjs.com/package/lindera-wasm-nodejs-unidic>
|
|
39
|
+
Lindera WASM with Japanese dictionary (UniDic) for Node.js
|
|
40
|
+
|
|
41
|
+
- <https://www.npmjs.com/package/lindera-wasm-nodejs-ko-dic>
|
|
42
|
+
Lindera WASM with Korean dictionary (ko-dic) for Node.js
|
|
43
|
+
|
|
44
|
+
- <https://www.npmjs.com/package/lindera-wasm-nodejs-cc-cedict>
|
|
45
|
+
Lindera WASM with Chinese dictionary (CC-CEDICT) for Node.js
|
|
46
|
+
|
|
47
|
+
## Usage
|
|
48
|
+
|
|
49
|
+
init the wasm module before construct `TokenizerBuilder`:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
import __wbg_init, { TokenizerBuilder } from 'lindera-wasm'
|
|
53
|
+
|
|
54
|
+
__wbg_init.then(() => {
|
|
55
|
+
const builder = new TokenizerBuilder()
|
|
56
|
+
//...
|
|
57
|
+
})
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### for [Vite](https://vite.dev/) base project
|
|
61
|
+
|
|
62
|
+
You should exclude this package in the `optimizeDeps`:
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
// vite.config.js
|
|
66
|
+
import { defineConfig } from 'vite'
|
|
67
|
+
|
|
68
|
+
export default defineConfig({
|
|
69
|
+
optimizeDeps: {
|
|
70
|
+
exclude: [
|
|
71
|
+
"lindera-wasm"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
})
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### for Browser extension development
|
|
78
|
+
|
|
79
|
+
Set the `cors` config in vite.config.js
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
// vite.config.js
|
|
83
|
+
import { defineConfig } from 'vite'
|
|
84
|
+
|
|
85
|
+
export default defineConfig({
|
|
86
|
+
server: {
|
|
87
|
+
cors: {
|
|
88
|
+
origin: [
|
|
89
|
+
/chrome-extension:\/\//,
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
})
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
and set the `content_security_policy` to contains `wasm-unsafe-eval` in manifest.json:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
"content_security_policy": {
|
|
100
|
+
"extension_pages": "script-src 'self' 'wasm-unsafe-eval';"
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Development
|
|
105
|
+
|
|
106
|
+
### Install project dependencies
|
|
107
|
+
|
|
108
|
+
- wasm-pack : <https://rustwasm.github.io/wasm-pack/installer/>
|
|
109
|
+
|
|
110
|
+
### Setup repository
|
|
111
|
+
|
|
112
|
+
```shell
|
|
113
|
+
# Clone the Lindera project repository
|
|
114
|
+
% git clone git@github.com:lindera/lindera.git
|
|
115
|
+
% cd lindera
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Build project
|
|
119
|
+
|
|
120
|
+
```shell
|
|
121
|
+
% make wasm-build
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Run tests
|
|
125
|
+
|
|
126
|
+
```shell
|
|
127
|
+
% make wasm-test
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Build example web application
|
|
131
|
+
|
|
132
|
+
```shell
|
|
133
|
+
% cd example && npm install && npm run build && cp index.html dist/index.html
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Run example web application
|
|
137
|
+
|
|
138
|
+
```shell
|
|
139
|
+
% cd example && npm run start
|
|
140
|
+
```
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Compression algorithm for dictionary data.
|
|
6
|
+
*/
|
|
7
|
+
export enum CompressionAlgorithm {
|
|
8
|
+
Deflate = 0,
|
|
9
|
+
Zlib = 1,
|
|
10
|
+
Gzip = 2,
|
|
11
|
+
Raw = 3,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A morphological analysis dictionary.
|
|
16
|
+
*/
|
|
17
|
+
export class Dictionary {
|
|
18
|
+
private constructor();
|
|
19
|
+
free(): void;
|
|
20
|
+
[Symbol.dispose](): void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Field definition in dictionary schema.
|
|
25
|
+
*/
|
|
26
|
+
export class FieldDefinition {
|
|
27
|
+
private constructor();
|
|
28
|
+
free(): void;
|
|
29
|
+
[Symbol.dispose](): void;
|
|
30
|
+
get description(): string | undefined;
|
|
31
|
+
set description(value: string | null | undefined);
|
|
32
|
+
field_type: FieldType;
|
|
33
|
+
index: number;
|
|
34
|
+
name: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Field type in dictionary schema.
|
|
39
|
+
*/
|
|
40
|
+
export enum FieldType {
|
|
41
|
+
/**
|
|
42
|
+
* Surface form (word text)
|
|
43
|
+
*/
|
|
44
|
+
Surface = 0,
|
|
45
|
+
/**
|
|
46
|
+
* Left context ID for morphological analysis
|
|
47
|
+
*/
|
|
48
|
+
LeftContextId = 1,
|
|
49
|
+
/**
|
|
50
|
+
* Right context ID for morphological analysis
|
|
51
|
+
*/
|
|
52
|
+
RightContextId = 2,
|
|
53
|
+
/**
|
|
54
|
+
* Word cost (used in path selection)
|
|
55
|
+
*/
|
|
56
|
+
Cost = 3,
|
|
57
|
+
/**
|
|
58
|
+
* Custom field (morphological features)
|
|
59
|
+
*/
|
|
60
|
+
Custom = 4,
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Error type for Lindera operations.
|
|
65
|
+
*/
|
|
66
|
+
export class LinderaError {
|
|
67
|
+
private constructor();
|
|
68
|
+
free(): void;
|
|
69
|
+
[Symbol.dispose](): void;
|
|
70
|
+
message: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Dictionary metadata configuration.
|
|
75
|
+
*/
|
|
76
|
+
export class Metadata {
|
|
77
|
+
private constructor();
|
|
78
|
+
free(): void;
|
|
79
|
+
[Symbol.dispose](): void;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Tokenization mode.
|
|
84
|
+
*
|
|
85
|
+
* Determines how text is segmented into tokens.
|
|
86
|
+
*/
|
|
87
|
+
export enum Mode {
|
|
88
|
+
/**
|
|
89
|
+
* Standard tokenization based on dictionary cost
|
|
90
|
+
*/
|
|
91
|
+
Normal = 0,
|
|
92
|
+
/**
|
|
93
|
+
* Decompose compound words using penalty-based segmentation
|
|
94
|
+
*/
|
|
95
|
+
Decompose = 1,
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Penalty configuration for decompose mode.
|
|
100
|
+
*
|
|
101
|
+
* Controls how aggressively compound words are decomposed based on
|
|
102
|
+
* character type and length thresholds.
|
|
103
|
+
*/
|
|
104
|
+
export class Penalty {
|
|
105
|
+
private constructor();
|
|
106
|
+
free(): void;
|
|
107
|
+
[Symbol.dispose](): void;
|
|
108
|
+
kanji_penalty_length_penalty: number;
|
|
109
|
+
kanji_penalty_length_threshold: number;
|
|
110
|
+
other_penalty_length_penalty: number;
|
|
111
|
+
other_penalty_length_threshold: number;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Dictionary schema definition.
|
|
116
|
+
*/
|
|
117
|
+
export class Schema {
|
|
118
|
+
private constructor();
|
|
119
|
+
free(): void;
|
|
120
|
+
[Symbol.dispose](): void;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Core segmenter for morphological analysis.
|
|
125
|
+
*/
|
|
126
|
+
export class Segmenter {
|
|
127
|
+
private constructor();
|
|
128
|
+
free(): void;
|
|
129
|
+
[Symbol.dispose](): void;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Token object wrapping the Rust Token data.
|
|
134
|
+
*
|
|
135
|
+
* This class provides robust access to token field and details.
|
|
136
|
+
*/
|
|
137
|
+
export class Token {
|
|
138
|
+
private constructor();
|
|
139
|
+
free(): void;
|
|
140
|
+
[Symbol.dispose](): void;
|
|
141
|
+
/**
|
|
142
|
+
* End byte position in the original text.
|
|
143
|
+
*/
|
|
144
|
+
byte_end: number;
|
|
145
|
+
/**
|
|
146
|
+
* Start byte position in the original text.
|
|
147
|
+
*/
|
|
148
|
+
byte_start: number;
|
|
149
|
+
/**
|
|
150
|
+
* Morphological details of the token.
|
|
151
|
+
*/
|
|
152
|
+
details: string[];
|
|
153
|
+
/**
|
|
154
|
+
* Position index of the token.
|
|
155
|
+
*/
|
|
156
|
+
position: number;
|
|
157
|
+
/**
|
|
158
|
+
* Surface form of the token.
|
|
159
|
+
*/
|
|
160
|
+
surface: string;
|
|
161
|
+
/**
|
|
162
|
+
* Word ID in the dictionary.
|
|
163
|
+
*/
|
|
164
|
+
word_id: number;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* A tokenizer for morphological analysis.
|
|
169
|
+
*/
|
|
170
|
+
export class Tokenizer {
|
|
171
|
+
free(): void;
|
|
172
|
+
[Symbol.dispose](): void;
|
|
173
|
+
constructor(dictionary: Dictionary, mode?: string | null, user_dictionary?: UserDictionary | null);
|
|
174
|
+
/**
|
|
175
|
+
* Tokenizes the input text.
|
|
176
|
+
*/
|
|
177
|
+
tokenize(input_text: string): Token[];
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Builder for creating a [`Tokenizer`] instance.
|
|
182
|
+
*
|
|
183
|
+
* `TokenizerBuilder` provides a fluent API for configuring and building a tokenizer
|
|
184
|
+
* with various options such as dictionary selection, tokenization mode, character filters,
|
|
185
|
+
* and token filters.
|
|
186
|
+
*/
|
|
187
|
+
export class TokenizerBuilder {
|
|
188
|
+
free(): void;
|
|
189
|
+
[Symbol.dispose](): void;
|
|
190
|
+
/**
|
|
191
|
+
* Appends a character filter to the tokenization pipeline.
|
|
192
|
+
*/
|
|
193
|
+
appendCharacterFilter(name: string, args: any): void;
|
|
194
|
+
/**
|
|
195
|
+
* Appends a token filter to the tokenization pipeline.
|
|
196
|
+
*/
|
|
197
|
+
appendTokenFilter(name: string, args: any): void;
|
|
198
|
+
append_character_filter(name: string, args: any): void;
|
|
199
|
+
append_token_filter(name: string, args: any): void;
|
|
200
|
+
/**
|
|
201
|
+
* Builds and returns a configured [`Tokenizer`] instance.
|
|
202
|
+
*/
|
|
203
|
+
build(): Tokenizer;
|
|
204
|
+
/**
|
|
205
|
+
* Creates a new `TokenizerBuilder` instance.
|
|
206
|
+
*/
|
|
207
|
+
constructor();
|
|
208
|
+
/**
|
|
209
|
+
* Sets the dictionary to use for tokenization.
|
|
210
|
+
*/
|
|
211
|
+
setDictionary(uri: string): void;
|
|
212
|
+
/**
|
|
213
|
+
* Sets whether to keep whitespace tokens in the output.
|
|
214
|
+
*/
|
|
215
|
+
setKeepWhitespace(keep: boolean): void;
|
|
216
|
+
/**
|
|
217
|
+
* Sets the tokenization mode.
|
|
218
|
+
*/
|
|
219
|
+
setMode(mode: string): void;
|
|
220
|
+
/**
|
|
221
|
+
* Sets a user-defined dictionary.
|
|
222
|
+
*/
|
|
223
|
+
setUserDictionary(uri: string): void;
|
|
224
|
+
set_dictionary(uri: string): void;
|
|
225
|
+
set_keep_whitespace(keep: boolean): void;
|
|
226
|
+
set_mode(mode: string): void;
|
|
227
|
+
set_user_dictionary(uri: string): void;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* A user-defined dictionary for custom words.
|
|
232
|
+
*/
|
|
233
|
+
export class UserDictionary {
|
|
234
|
+
private constructor();
|
|
235
|
+
free(): void;
|
|
236
|
+
[Symbol.dispose](): void;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Builds a dictionary from source files.
|
|
241
|
+
*/
|
|
242
|
+
export function buildDictionary(input_dir: string, output_dir: string, metadata: Metadata): void;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Builds a user dictionary from a CSV file.
|
|
246
|
+
*/
|
|
247
|
+
export function buildUserDictionary(input_file: string, output_dir: string, metadata?: Metadata | null): void;
|
|
248
|
+
|
|
249
|
+
export function build_dictionary(input_dir: string, output_dir: string, metadata: Metadata): void;
|
|
250
|
+
|
|
251
|
+
export function build_user_dictionary(input_file: string, output_dir: string, metadata?: Metadata | null): void;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Gets the version of the lindera-wasm library.
|
|
255
|
+
* Backward compatibility alias for version().
|
|
256
|
+
*/
|
|
257
|
+
export function getVersion(): string;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Loads a dictionary from the specified URI.
|
|
261
|
+
*/
|
|
262
|
+
export function loadDictionary(uri: string): Dictionary;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Loads a user dictionary from the specified URI.
|
|
266
|
+
*/
|
|
267
|
+
export function loadUserDictionary(uri: string, metadata: Metadata): UserDictionary;
|
|
268
|
+
|
|
269
|
+
export function load_dictionary(uri: string): Dictionary;
|
|
270
|
+
|
|
271
|
+
export function load_user_dictionary(uri: string, metadata: Metadata): UserDictionary;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Returns the version of the lindera-wasm package.
|
|
275
|
+
*/
|
|
276
|
+
export function version(): string;
|
|
277
|
+
|
|
278
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
279
|
+
|
|
280
|
+
export interface InitOutput {
|
|
281
|
+
readonly memory: WebAssembly.Memory;
|
|
282
|
+
readonly __wbg_linderaerror_free: (a: number, b: number) => void;
|
|
283
|
+
readonly __wbg_metadata_free: (a: number, b: number) => void;
|
|
284
|
+
readonly jslinderaerror_new: (a: number, b: number) => number;
|
|
285
|
+
readonly jslinderaerror_toString: (a: number) => [number, number];
|
|
286
|
+
readonly jsmetadata_compress_algorithm: (a: number) => number;
|
|
287
|
+
readonly jsmetadata_createDefault: () => number;
|
|
288
|
+
readonly jsmetadata_dictionary_schema: (a: number) => number;
|
|
289
|
+
readonly jsmetadata_encoding: (a: number) => [number, number];
|
|
290
|
+
readonly jsmetadata_name: (a: number) => [number, number];
|
|
291
|
+
readonly jsmetadata_new: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
292
|
+
readonly jsmetadata_set_compress_algorithm: (a: number, b: number) => void;
|
|
293
|
+
readonly jsmetadata_set_dictionary_schema: (a: number, b: number) => void;
|
|
294
|
+
readonly jsmetadata_set_encoding: (a: number, b: number, c: number) => void;
|
|
295
|
+
readonly jsmetadata_set_name: (a: number, b: number, c: number) => void;
|
|
296
|
+
readonly jsmetadata_set_user_dictionary_schema: (a: number, b: number) => void;
|
|
297
|
+
readonly jsmetadata_user_dictionary_schema: (a: number) => number;
|
|
298
|
+
readonly __wbg_get_token_byte_end: (a: number) => number;
|
|
299
|
+
readonly __wbg_get_token_details: (a: number) => [number, number];
|
|
300
|
+
readonly __wbg_get_token_position: (a: number) => number;
|
|
301
|
+
readonly __wbg_get_token_word_id: (a: number) => number;
|
|
302
|
+
readonly __wbg_set_token_byte_end: (a: number, b: number) => void;
|
|
303
|
+
readonly __wbg_set_token_details: (a: number, b: number, c: number) => void;
|
|
304
|
+
readonly __wbg_set_token_position: (a: number, b: number) => void;
|
|
305
|
+
readonly __wbg_set_token_word_id: (a: number, b: number) => void;
|
|
306
|
+
readonly __wbg_token_free: (a: number, b: number) => void;
|
|
307
|
+
readonly jstoken_getDetail: (a: number, b: number) => [number, number];
|
|
308
|
+
readonly jstoken_toJSON: (a: number) => any;
|
|
309
|
+
readonly __wbg_get_penalty_kanji_penalty_length_penalty: (a: number) => number;
|
|
310
|
+
readonly __wbg_get_penalty_kanji_penalty_length_threshold: (a: number) => number;
|
|
311
|
+
readonly __wbg_get_penalty_other_penalty_length_penalty: (a: number) => number;
|
|
312
|
+
readonly __wbg_get_penalty_other_penalty_length_threshold: (a: number) => number;
|
|
313
|
+
readonly __wbg_penalty_free: (a: number, b: number) => void;
|
|
314
|
+
readonly __wbg_segmenter_free: (a: number, b: number) => void;
|
|
315
|
+
readonly __wbg_set_penalty_kanji_penalty_length_penalty: (a: number, b: number) => void;
|
|
316
|
+
readonly __wbg_set_penalty_kanji_penalty_length_threshold: (a: number, b: number) => void;
|
|
317
|
+
readonly __wbg_set_penalty_other_penalty_length_penalty: (a: number, b: number) => void;
|
|
318
|
+
readonly __wbg_set_penalty_other_penalty_length_threshold: (a: number, b: number) => void;
|
|
319
|
+
readonly build_dictionary: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
320
|
+
readonly build_user_dictionary: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
321
|
+
readonly getVersion: () => [number, number];
|
|
322
|
+
readonly jspenalty_new: (a: number, b: number, c: number, d: number) => number;
|
|
323
|
+
readonly load_dictionary: (a: number, b: number) => [number, number, number];
|
|
324
|
+
readonly load_user_dictionary: (a: number, b: number, c: number) => [number, number, number];
|
|
325
|
+
readonly __wbg_tokenizer_free: (a: number, b: number) => void;
|
|
326
|
+
readonly __wbg_tokenizerbuilder_free: (a: number, b: number) => void;
|
|
327
|
+
readonly tokenizer_new: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
328
|
+
readonly tokenizer_tokenize: (a: number, b: number, c: number) => [number, number, number, number];
|
|
329
|
+
readonly tokenizerbuilder_appendCharacterFilter: (a: number, b: number, c: number, d: any) => [number, number];
|
|
330
|
+
readonly tokenizerbuilder_appendTokenFilter: (a: number, b: number, c: number, d: any) => [number, number];
|
|
331
|
+
readonly tokenizerbuilder_append_character_filter: (a: number, b: number, c: number, d: any) => [number, number];
|
|
332
|
+
readonly tokenizerbuilder_append_token_filter: (a: number, b: number, c: number, d: any) => [number, number];
|
|
333
|
+
readonly tokenizerbuilder_build: (a: number) => [number, number, number];
|
|
334
|
+
readonly tokenizerbuilder_new: () => [number, number, number];
|
|
335
|
+
readonly tokenizerbuilder_setDictionary: (a: number, b: number, c: number) => [number, number];
|
|
336
|
+
readonly tokenizerbuilder_setKeepWhitespace: (a: number, b: number) => [number, number];
|
|
337
|
+
readonly tokenizerbuilder_setMode: (a: number, b: number, c: number) => [number, number];
|
|
338
|
+
readonly tokenizerbuilder_setUserDictionary: (a: number, b: number, c: number) => [number, number];
|
|
339
|
+
readonly tokenizerbuilder_set_dictionary: (a: number, b: number, c: number) => [number, number];
|
|
340
|
+
readonly tokenizerbuilder_set_keep_whitespace: (a: number, b: number) => [number, number];
|
|
341
|
+
readonly tokenizerbuilder_set_mode: (a: number, b: number, c: number) => [number, number];
|
|
342
|
+
readonly tokenizerbuilder_set_user_dictionary: (a: number, b: number, c: number) => [number, number];
|
|
343
|
+
readonly __wbg_fielddefinition_free: (a: number, b: number) => void;
|
|
344
|
+
readonly __wbg_get_fielddefinition_description: (a: number) => [number, number];
|
|
345
|
+
readonly __wbg_get_fielddefinition_field_type: (a: number) => number;
|
|
346
|
+
readonly __wbg_get_fielddefinition_index: (a: number) => number;
|
|
347
|
+
readonly __wbg_get_fielddefinition_name: (a: number) => [number, number];
|
|
348
|
+
readonly __wbg_schema_free: (a: number, b: number) => void;
|
|
349
|
+
readonly __wbg_set_fielddefinition_description: (a: number, b: number, c: number) => void;
|
|
350
|
+
readonly __wbg_set_fielddefinition_field_type: (a: number, b: number) => void;
|
|
351
|
+
readonly __wbg_set_fielddefinition_index: (a: number, b: number) => void;
|
|
352
|
+
readonly __wbg_set_fielddefinition_name: (a: number, b: number, c: number) => void;
|
|
353
|
+
readonly jsfielddefinition_new: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
354
|
+
readonly jsschema_create_default: () => number;
|
|
355
|
+
readonly jsschema_field_count: (a: number) => number;
|
|
356
|
+
readonly jsschema_get_all_fields: (a: number) => [number, number];
|
|
357
|
+
readonly jsschema_get_custom_fields: (a: number) => [number, number];
|
|
358
|
+
readonly jsschema_get_field_by_name: (a: number, b: number, c: number) => number;
|
|
359
|
+
readonly jsschema_get_field_index: (a: number, b: number, c: number) => number;
|
|
360
|
+
readonly jsschema_get_field_name: (a: number, b: number) => [number, number];
|
|
361
|
+
readonly jsschema_new: (a: number, b: number) => number;
|
|
362
|
+
readonly __wbg_dictionary_free: (a: number, b: number) => void;
|
|
363
|
+
readonly __wbg_userdictionary_free: (a: number, b: number) => void;
|
|
364
|
+
readonly buildDictionary: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
365
|
+
readonly buildUserDictionary: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
366
|
+
readonly jsdictionary_encoding: (a: number) => [number, number];
|
|
367
|
+
readonly jsdictionary_metadata: (a: number) => number;
|
|
368
|
+
readonly jsdictionary_name: (a: number) => [number, number];
|
|
369
|
+
readonly loadDictionary: (a: number, b: number) => [number, number, number];
|
|
370
|
+
readonly loadUserDictionary: (a: number, b: number, c: number) => [number, number, number];
|
|
371
|
+
readonly version: () => [number, number];
|
|
372
|
+
readonly __wbg_set_token_byte_start: (a: number, b: number) => void;
|
|
373
|
+
readonly __wbg_set_token_surface: (a: number, b: number, c: number) => void;
|
|
374
|
+
readonly __wbg_set_linderaerror_message: (a: number, b: number, c: number) => void;
|
|
375
|
+
readonly __wbg_get_token_byte_start: (a: number) => number;
|
|
376
|
+
readonly __wbg_get_token_surface: (a: number) => [number, number];
|
|
377
|
+
readonly __wbg_get_linderaerror_message: (a: number) => [number, number];
|
|
378
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
379
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
380
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
381
|
+
readonly __externref_table_alloc: () => number;
|
|
382
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
383
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
384
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
385
|
+
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
386
|
+
readonly __wbindgen_start: () => void;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
393
|
+
* a precompiled `WebAssembly.Module`.
|
|
394
|
+
*
|
|
395
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
396
|
+
*
|
|
397
|
+
* @returns {InitOutput}
|
|
398
|
+
*/
|
|
399
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
403
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
404
|
+
*
|
|
405
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
406
|
+
*
|
|
407
|
+
* @returns {Promise<InitOutput>}
|
|
408
|
+
*/
|
|
409
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|