Skip to content

Installation ​

Pick Your Runtime ​

RuntimePackagePrebuiltRequirements
Browser, Node.js, Deno, Bun@libraz/suzume on npmYes: one WASM build for every platformNode.js 18.0+, Deno 1.31+ (npm:@libraz/suzume), Bun 1.0+, or a browser with WebAssembly
Pythonsuzume on PyPILinux x86_64 (manylinux2014 / manylinux_2_17) and macOS arm64 (macOS 11+) wheels only. Windows, macOS x86_64, Linux arm64, and other platforms are not supported, and there is no source distributionPython 3.10+
Gogithub.com/libraz/go-suzumeNo: builds the C++ core from sourceGo 1.26+, CGO, C++17 compiler, CMake 3.15+
C / C++Source checkout of libraz/suzumeNoC++17 compiler, CMake 3.15+
Native suzume-cliSource checkout of libraz/suzumeNoC++17 compiler, CMake 3.15+

JavaScript ​

For JavaScript, TypeScript, and browser usage, install the WASM package:

bash
npm install @libraz/suzume
bash
yarn add @libraz/suzume
bash
pnpm add @libraz/suzume
bash
bun add @libraz/suzume

The package bundles the WASM binary and its dictionaries, so no other files are needed at runtime.

The binary is also exported as the @libraz/suzume/wasm subpath. When a bundler does not resolve the asset on its own, import its URL and pass it as wasmPath:

typescript
import { Suzume } from '@libraz/suzume'
import wasmUrl from '@libraz/suzume/wasm?url' // Vite

const suzume = await Suzume.create({ wasmPath: wasmUrl })

CDN ​

For browser usage without a build step:

html
<script type="module">
  import { Suzume } from 'https://cdn.jsdelivr.net/npm/@libraz/suzume/dist/index.js'

  const suzume = await Suzume.create()
  console.log(suzume.analyze('こんにちは'))
  suzume.destroy() // when finished
</script>

Python ​

For Python applications and data pipelines, install the wheel from PyPI:

bash
pip install suzume
bash
poetry add suzume
bash
uv add suzume

pip install succeeds only on the platforms listed in Pick Your Runtime, because no source distribution exists to fall back on. The wheel contains the native library and dictionaries and also installs the suzume command. See the Python bindings guide for the API and Python CLI for the command.

Go ​

The cgo binding builds its C++ core from source, which go get cannot do inside the read-only module cache. Clone it, build the pinned core and dictionaries, then reference the checkout from your module:

bash
git clone https://github.com/libraz/go-suzume.git
cd go-suzume && make lib

Then, from your own module:

bash
go mod edit -replace github.com/libraz/go-suzume=/path/to/go-suzume
go get github.com/libraz/go-suzume

The resulting application embeds its dictionaries and does not need external dictionary files at runtime. After rebuilding the core, use go build -a in the application module so Go relinks the static library. See the Go bindings guide for source synchronization, initialization, ownership, options, and API details.

Command-line Tools ​

Two commands exist, and only one of them compiles dictionaries:

CommandComes fromAnalysis and tagsdict compile, validation, tests, benchmarks
suzumeThe PyPI wheelYesNo
suzume-cliA source build of libraz/suzumeYesYes

Installing the Python wheel provides suzume:

bash
suzume --format json "東京へ行く"

Native suzume-cli ​

Neither the npm package nor the PyPI wheel contains suzume-cli. Build and install it from a source checkout:

bash
git clone https://github.com/libraz/suzume.git
cd suzume
make install   # installs suzume-cli into /usr/local/bin; override with PREFIX=/opt/suzume

make install also installs the C / C++ library, headers, and the compiled dictionaries under $PREFIX/share/suzume, where suzume-cli finds them. To run the CLI from the checkout without installing anything, build it as described in Native Build and run build/bin/suzume-cli. See the Native CLI reference for its commands.

C / C++ ​

To link Suzume directly into a native C or C++ program, build and install the library from source:

bash
git clone https://github.com/libraz/suzume.git
cd suzume
make install                 # into /usr/local; override with PREFIX=/opt/suzume

This is the same command that installs suzume-cli. See the C / C++ library guide for usage, CMake find_package, pkg-config, and builds with embedded dictionaries.