mecab 0.1.0 copy "mecab: ^0.1.0" to clipboard
mecab: ^0.1.0 copied to clipboard

Japanese morphological analysis, powered by MeCab.

mecab #

pub package

Japanese morphological analysis for Dart, powered by MeCab.

The native library compiles automatically via Dart Native Assets (requires a C++ compiler).

Usage #

import 'package:mecab/mecab.dart';

final mecab = Mecab.init('/path/to/ipadic');

final tokens = mecab.parse('すもももももももものうち');
for (final token in tokens) {
  print('${token.surface}\t${token.reading}');
}
// すもも	スモモ
// も	モ
// もも	モモ
// も	モ
// もも	モモ
// の	ノ
// うち	ウチ

mecab.dispose();

Dictionary #

MeCab needs a compiled IpaDic dictionary. Install via your system package manager:

# macOS
brew install mecab-ipadic

# Ubuntu/Debian
apt-get install mecab-ipadic-utf8

Then pass the dictionary path to Mecab.init().

License #

BSD 3-Clause. MeCab is included under its BSD license option.

0
likes
150
points
35
downloads

Documentation

API reference

Publisher

verified publishergau.moe

Weekly Downloads

Japanese morphological analysis, powered by MeCab.

Repository (GitHub)
View/report issues

Topics

#japanese #nlp #morphology #tts #ffi

License

BSD-3-Clause (license)

Dependencies

ffi, hooks, native_toolchain_c

More

Packages that depend on mecab