Exemple #1
0
int segmentor_segment(void * segmentor,
        const std::string & str,
        std::vector<std::string> & words) {
    // std::cout << "input str = " << str << std::endl;
    SegmentorWrapper * wrapper = 0;
    wrapper = reinterpret_cast<SegmentorWrapper *>(segmentor);
    return wrapper->segment(str.c_str(), words);
}
Exemple #2
0
int segmentor_segment(void * segmentor,
    const std::string & str,
    std::vector<std::string> & words) {
  if (str.empty()) {
    return 0;
  }

  SegmentorWrapper * wrapper = 0;
  wrapper = reinterpret_cast<SegmentorWrapper *>(segmentor);
  return wrapper->segment(str.c_str(), words);
}