| Crates.io | lindera-wasm |
| lib.rs | lindera-wasm |
| version | 2.0.0 |
| created_at | 2025-04-01 12:42:08.286082+00 |
| updated_at | 2026-01-11 12:37:27.349151+00 |
| description | A morphological analysis library for WebAssembly. |
| homepage | https://github.com/lindera/lindera-wasm |
| repository | https://github.com/lindera/lindera-wasm |
| max_upload_size | |
| id | 1614797 |
| size | 251,676 |
WebAssembly of Lindera
https://www.npmjs.com/package/lindera-wasm-web-cjk
Lindera WASM with CJK dictionaries (IPADIC, ko-dic, CC-CEDICT) for Web
https://www.npmjs.com/package/lindera-wasm-web-ipadic
Lindera WASM with Japanese dictionary (IPADIC) for Web
https://www.npmjs.com/package/lindera-wasm-web-unidic
Lindera WASM with Japanese dictionary (UniDic) for Web
https://www.npmjs.com/package/lindera-wasm-web-ko-dic
Lindera WASM with Korean dictionary (ko-dic) for Web
https://www.npmjs.com/package/lindera-wasm-web-cc-cedict
Lindera WASM with Chinese dictionary (CC-CEDICT) for Web
https://www.npmjs.com/package/lindera-wasm-nodejs-cjk
Lindera WASM with CJK dictionaries (IPADIC, ko-dic, CC-CEDICT) for Node.js
https://www.npmjs.com/package/lindera-wasm-nodejs-ipadic
Lindera WASM with Japanese dictionary (IPADIC) for Node.js
https://www.npmjs.com/package/lindera-wasm-nodejs-unidic
Lindera WASM with Japanese dictionary (UniDic) for Node.js
https://www.npmjs.com/package/lindera-wasm-nodejs-ko-dic
Lindera WASM with Korean dictionary (ko-dic) for Node.js
https://www.npmjs.com/package/lindera-wasm-nodejs-cc-cedict
Lindera WASM with Chinese dictionary (CC-CEDICT) for Node.js
init the wasm module before construct TokenizerBuilder:
import __wbg_init, { TokenizerBuilder } from 'lindera-wasm'
__wbg_init.then(() => {
const builder = new TokenizerBuilder()
//...
})
You should exclude this package in the optimizeDeps:
// vite.config.js
import { defineConfig } from 'vite'
export default defineConfig({
optimizeDeps: {
exclude: [
"lindera-wasm"
]
},
})
Set the cors config in vite.config.js
// vite.config.js
import { defineConfig } from 'vite'
export default defineConfig({
server: {
cors: {
origin: [
/chrome-extension:\/\//,
],
},
},
})
and set the content_security_policy to contains wasm-unsafe-eval in manifest.json:
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval';"
}
# Clone lindera-py project repository
% git clone git@github.com:lindera/lindera-wasm.git
% cd lindera-wasm
% wasm-pack build --release --features=cjk --target=bundler
% cd lindera-wasm && npm install && npm run build && cp index.html dist/index.html
% cd lindera-wasm && npm run start