Lindera WASM CJK Bundler is a JavaScript package providing morphological analysis for Chinese, Japanese, and Korean languages, optimized for environments using module bundlers. It leverages WebAssembly (WASM) for efficient tokenization, integrating IPADIC (Japanese), ko-dic (Korean), and CC-CEDICT (Chinese) dictionaries directly into the bundle. The package is currently at version 2.3.4, with the main Lindera project actively releasing new major versions (e.g., v3.x) that introduce significant architectural changes, including new NAPI-RS Node.js bindings and updated package naming conventions. Lindera's core differentiator is its multilingual CJK support via WASM, offering performance benefits in browser and bundler-driven Node.js environments compared to pure JavaScript or server-side solutions, with a focus on embedded dictionaries for ease of use. It aims for ease of deployment in complex modern JavaScript ecosystems requiring bundling.
npm install lindera-wasm-cjk-bundlerVerified import paths — ran on the pinned version, not inferred.
Initializes the Lindera WASM CJK tokenizer, demonstrates setting the embedded CJK dictionary, tokenizing a multi-language CJK string, and logging the analysis results.
Migrate to `lindera-wasm-cjk-nodejs` for direct Node.js environments or use this `lindera-wasm-cjk-bundler` package with a module bundler (like Webpack, Rollup, esbuild) that targets Node.js. Update import paths and package names in your `package.json` accordingly.
Always call and `await` the `__wbg_init()` function at the start of your application's execution flow before instantiating `TokenizerBuilder` or other Lindera WASM components.
When targeting web browsers, ensure your project utilizes a module bundler. When targeting Node.js, for direct usage, consider `lindera-wasm-cjk-nodejs`. If using this `bundler` variant for Node.js, ensure your bundler is configured to output Node.js-compatible modules.
Ensure `builder.setDictionary("embedded://cjk")` is used when utilizing `lindera-wasm-cjk-bundler` to leverage its integrated dictionaries. For other specific dictionary needs, use their corresponding `lindera-wasm-*` packages (e.g., `lindera-wasm-ipadic-bundler`).Ensure you `await __wbg_init();` before attempting to use `TokenizerBuilder`. Also, verify `TokenizerBuilder` is imported as a named export: `import { TokenizerBuilder } from 'lindera-wasm-cjk-bundler';`.Use ES Module `import` syntax (`import __wbg_init, { TokenizerBuilder } from 'lindera-wasm-cjk-bundler';`) in your project and ensure your environment (e.g., Node.js with `"type": "module"` in `package.json`, or a bundler) correctly handles ESM.For `lindera-wasm-cjk-bundler`, always use `builder.setDictionary("embedded://cjk")`. If you intend to use a specific dictionary like IPADIC, you should use `lindera-wasm-ipadic-bundler` and `builder.setDictionary("embedded://ipadic")`.No dependency data recorded yet.