Beispiel #1
0
void * segmentor_create_customized_segmentor(const char * baseline_model_path,
                                  const char * model_path,
                                  const char * lexicon_path) {
  SegmentorWrapper * wrapper = new SegmentorWrapper();

  if (!wrapper->load_baseline(baseline_model_path)) {
    delete wrapper;
    return 0;
  }

  if (!wrapper->load_customized(model_path, lexicon_path)) {
    delete wrapper;
    return 0;
  }

  return reinterpret_cast<void *>(wrapper);
}