Example #1
0
int postagger_postag(void * postagger,
        const std::vector<std::string> & words,
        std::vector<std::string> & tags) {
    // std::cout << "input str = " << str << std::endl;
    PostaggerWrapper * wrapper = 0;
    wrapper = reinterpret_cast<PostaggerWrapper *>(postagger);
    return wrapper->postag(words, tags);
}
Example #2
0
int postagger_postag(void * postagger,
    const std::vector<std::string> & words,
    std::vector<std::string> & tags) {
  if (0 == words.size()) {
    return 0;
  }

  for (int i = 0; i < words.size(); ++ i) {
    if (words[i].empty()) {
      return 0;
    }
  }

  PostaggerWrapper * wrapper = 0;
  wrapper = reinterpret_cast<PostaggerWrapper *>(postagger);
  return wrapper->postag(words, tags);
}