Skip to content

lindera/lindera-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lindera-wasm

WebAssembly of Lindera

Screenshot from 2025-09-13 23-05-49

Demo Application

npm

Web

Node.js

Usage

init the wasm module before construct TokenizerBuilder:

import __wbg_init, { TokenizerBuilder } from 'lindera-wasm'

__wbg_init.then(() => {
    const builder = new TokenizerBuilder()
    //...
})

for Vite base project

You should exclude this package in the optimizeDeps:

// vite.config.js
import { defineConfig } from 'vite'

export default defineConfig({
  optimizeDeps: {
    exclude: [
      "lindera-wasm"
    ]
  },
})

for Browser extension development

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';"
}

Development

Install project dependencies

Setup repository

# Clone lindera-py project repository
% git clone [email protected]:lindera/lindera-wasm.git
% cd lindera-wasm

Build project

% wasm-pack build --release --features=cjk --target=bundler

Build example web application

% cd lindera-wasm && npm install && npm run build && cp index.html dist/index.html

Run example web application

% cd lindera-wasm && npm run start

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •