using mecab iPhone

Discussion in 'iOS Programming' started by jaeho, Jul 27, 2011.

  1. macrumors newbie

    Jul 27, 2011

    I am trying to use mecab parse Japanese words on iPhone and it's not going so well.
    I cannot create mecab object.
    Below is what I have tried.

    1) I tried using C code.
    #import "mecab.h"


    // mecab intializes to NULL
    mecab_t *mecab = mecab_new2 ("");

    2) I tried using C++ wrapper class

    #include <mecab.h>

    // tagger initializes to NULL
    char *argv[] = {"mecab", "-a"};
    MeCab::Tagger *tagger = MeCab::createTagger (1, argv);

    What am I doing wrong?
    Any help will be appreciated.

    Thanks in advance.


Share This Page