Esempio n. 1
0
int segmentor_customized_segment(void * segmentor,
                                 const std::string & str,
                                 std::vector<std::string> & words) {
  if (str.empty()) {
    return 0;
  }
  SegmentorWrapper * wrapper = reinterpret_cast<SegmentorWrapper*>(segmentor);
  return wrapper->customized_segment(str, words);
}
Esempio n. 2
0
int segmentor_customized_segment_online(void * parser,
                      const char * model_path,
                      const char * lexicon_path,
                      const std::string & line,
                      std::vector<std::string> & words) {
  if (line.empty()) {
    return 0;
  }

  SegmentorWrapper * wrapper = 0;
  wrapper = reinterpret_cast<SegmentorWrapper *>(parser);
  return wrapper->customized_segment(model_path, lexicon_path, line.c_str(), words);
}