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

outdated

A new flutter plugin project.

mecab_dart #

MeCab(Japanese Morphological Analyzer) wrapper for Flutter on iOS/Android.

Usage #

  1. Add this plug_in mecab_flutter as a dependency in your pubspec.yaml file.

  2. Copy Mecab dictionary (ipadic) to your assets folder

  3. Try the following example.

Example #

Init the tagger:

var tagger = new Mecab();
await tagger.init("assets/ipadic", true);

Set the boolean option in init function to true if you want to get the tokens including features, set it to false if you only want the token surfaces.

Use the tagger to parse text:

var tokens = tagger.parse('にわにわにわにわとりがいる。');
var text = '';

for(var token in tokens) {
  text += token.surface + "\t";
  for(var i = 0; i < token.features.length; i++) {
    text += token.features[i];
    if(i + 1 < token.features.length) {
       text += ",";
    }
  }
  text += "\n";
}
12
likes
0
pub points
77%
popularity

Publisher

unverified uploader

A new flutter plugin project.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

ffi, flutter, path_provider

More

Packages that depend on mecab_dart