mecab-sys
Rust FFI bindings for MeCab.
mecab-sys provides raw, unsafe FFI bindings to the MeCab (C++) library.
This crate is designed to be completely self-contained: it bundles the MeCab source code, compiles it directly using the cc crate, and links it statically. You do not need to install MeCab on your system to use this crate.
Only 1-best prediction mode is supported now. If you want to train a model, or if you want to predict N-best solutions, still you have to use MeCab.
MeCab is configured with UTF-8 only.
Prerequisites
This crate does not bundle the MeCab model files. To actually use MeCab for text analysis, you must download (or train by yourself) a pre-trained model.
You will also need a standard C++ compiler (like g++ or clang++) installed on your system so the cc crate can build the bundled C++ source.
To configure the compiler behavior, check the documentation of cc.
Installation
Add mecab-sys to your Cargo.toml:
[]
= "0.1.0"
Usage
Basic usage for Japanese morphological analysis:
use Model;