Installation
Pick Your Runtime
| Runtime | Package | Prebuilt | Requirements |
|---|---|---|---|
| Browser, Node.js, Deno, Bun | @libraz/suzume on npm | Yes: one WASM build for every platform | Node.js 18.0+, Deno 1.31+ (npm:@libraz/suzume), Bun 1.0+, or a browser with WebAssembly |
| Python | suzume on PyPI | Linux 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 distribution | Python 3.10+ |
| Go | github.com/libraz/go-suzume | No: builds the C++ core from source | Go 1.26+, CGO, C++17 compiler, CMake 3.15+ |
| C / C++ | Source checkout of libraz/suzume | No | C++17 compiler, CMake 3.15+ |
Native suzume-cli | Source checkout of libraz/suzume | No | C++17 compiler, CMake 3.15+ |
JavaScript
For JavaScript, TypeScript, and browser usage, install the WASM package:
npm install @libraz/suzumeyarn add @libraz/suzumepnpm add @libraz/suzumebun add @libraz/suzumeThe 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:
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:
<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:
pip install suzumepoetry add suzumeuv add suzumepip 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:
git clone https://github.com/libraz/go-suzume.git
cd go-suzume && make libThen, from your own module:
go mod edit -replace github.com/libraz/go-suzume=/path/to/go-suzume
go get github.com/libraz/go-suzumeThe 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:
| Command | Comes from | Analysis and tags | dict compile, validation, tests, benchmarks |
|---|---|---|---|
suzume | The PyPI wheel | Yes | No |
suzume-cli | A source build of libraz/suzume | Yes | Yes |
Installing the Python wheel provides suzume:
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:
git clone https://github.com/libraz/suzume.git
cd suzume
make install # installs suzume-cli into /usr/local/bin; override with PREFIX=/opt/suzumemake 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:
git clone https://github.com/libraz/suzume.git
cd suzume
make install # into /usr/local; override with PREFIX=/opt/suzumeThis 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.