dttvn0010 / mecab_dart

BSD 3-Clause "New" or "Revised" License
20 stars 15 forks source link

No output on android #8

Closed CaptainDario closed 1 year ago

CaptainDario commented 1 year ago

When I try to run the plugin in a new android app, there is no output. The compilation goes through fine but there is no output. Do you have any ideas why?

CaptainDario commented 1 year ago

I am using the default counter app with this addition:

...

  var tagger = new Mecab();
  String text = "";

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    mecab();
  }

  Future<void> mecab () async {
    await tagger.init("assets/ipadic", true);

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

      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";
      }
      print("text: $text");
  }
...
CaptainDario commented 1 year ago

Seems like this only happens on Windows. Building on MacOS for android works fine.

dttvn0010 commented 1 year ago

Can you try again to see if it is working now?

CaptainDario commented 1 year ago

@dttvn0010 yes, seems to be working now. Thank you!

Would be nice if you could publish a new version with all the new changes.