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

outdated

A Dart implementation of Ve. A linguistic framework that's easy to use. No degree required.

ve_dart #

"離さないって決めたから" => ["離さない", "って", "決めた", "から"]
"そぞろに鼻を利かせては" => ["そぞろに", "鼻", "を", "利かせて", "は"]
"無作為に伸びてる雑草も" => ["無", "作為に", "伸びてる", "雑草", "も"]
"守りたいって言ったのさ" => ["守りたい", "って", "言った", "の", "さ"]
"何が起きようと変わらないままで" => ["何", "が", "起きよ", "う", "と", "変わらない", "まま", "で"]

A Dart implementation of Ve. A linguistic framework that's easy to use. No degree required.

🚨 Dependencies #

This package requires use of the mecab_dart package, which in turn makes use of ipadic dictionary files.

  1. Add the following dependencies in your pubspec.yaml file.
dependencies:   
   mecab_dart: 0.1.2
   ve_dart: 0.1.0
  1. Copy the ipadic dictionary files in assets/ipadic to your own assets folder.

  2. Append the following to the assets section of your pubspec.yaml file

flutter:
  assets:
    - assets/ipadic/
  1. Add the following imports to your code.
import 'package:mecab_dart/mecab_dart.dart';
import 'package:ve_dart/ve_dart.dart';

When done, you're ready to use the example below.

📖 Example #

// Initialise a mecab_dart tagger.
mecabTagger = Mecab();
await mecabTagger.init("assets/ipadic", true);

// Make a List<TokenNode> that can be passed to the constructor of Parse.
List<dynamic> parsed = mecabTagger.parse("今未練なんかこれっぽっちも無い");
List<TokenNode> tokens = parsed.map((n) => n as TokenNode).toList();
Parse parse = Parse(tokens);

// Make the output list.
List<Word> words = parse.words();
List<String> output = [];
for (var word in words) {
  output.add(word.toString());
}

print(output); // ["今", "未練", "なんか", "これ", "っぽっ", "ち", "も", "無い"]
1
likes
0
pub points
40%
popularity

Publisher

unverified uploader

A Dart implementation of Ve. A linguistic framework that's easy to use. No degree required.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, mecab_dart

More

Packages that depend on ve_dart