8 releases

0.1.9 Oct 24, 2021
0.1.8 Oct 24, 2021

#481 in Text processing

Download history 4/week @ 2022-11-27 8/week @ 2022-12-04 19/week @ 2022-12-11 8/week @ 2022-12-18 8/week @ 2022-12-25 4/week @ 2023-01-01 8/week @ 2023-01-08 6/week @ 2023-01-15 12/week @ 2023-01-22 21/week @ 2023-01-29 12/week @ 2023-02-05 21/week @ 2023-02-12 26/week @ 2023-02-19 12/week @ 2023-02-26 10/week @ 2023-03-05 3/week @ 2023-03-12

51 downloads per month
Used in 2 crates

Apache-2.0 OR MIT

825 lines


goya at crates.io goya at docs.rs

Goya is a Japanese Morphological Analyzer written in Rust.
The main goal is to compile to WebAssembly for morphological analysis in browsers and other JavaScript runtimes. In addition, it can be used with the CLI and Rust.

Try Goya playground. It uses the Goya-wasm from WebWorker.

Getting started

Fetch the latest IPA dictionary

Download the latest IPA dictionary from the official Mecab website and unzip it.

Install Goya CLI

cargo install goya-cli

Compile the IPA dictionary

Compile the IPA dictionary to generate a binary dictionary for morphological analysis. It may take a few minutes.

goya compile /path/to/ipadic

The binary dictionary will be generated in the ~/.goya directory by default. You can change the destination with the --dicdir option.

goya --dicdir=/path/to/generated compile /path/to/ipadic

Run Morphological Analysis

Goya takes input from STDIN. The easiest way is using the echo command and pipe it to the Goya.

$ echo すもももももももものうち | goya
すもも	名詞,一般,*,*,*,*,すもも,スモモ,スモモ
もも	名詞,一般,*,*,*,*,もも,モモ,モモ
もも	名詞,一般,*,*,*,*,もも,モモ,モモ
うち	名詞,非自立,副詞可能,*,*,*,うち,ウチ,ウチ

If you specified the --dicdir option when compiling the dictionary, you should also specify it when running the goya command.

echo すもももももももものうち | goya --dicdir=/path/to/generated


cargo release <patch|minor|major> --workspace --no-tag --skip-publish --dependent-version Upgrade
git tag v{{VERSION}}
git push origin v{{VERSION}}


~64K SLoC