String chartMorphAnalyzerConf = "conf/plugin/MajorPlugin/MorphAnalyzer/ChartMorphAnalyzer.json";
String hmmTaggerAnalyzerConf = "conf/plugin/MajorPlugin/PosTagger/HmmPosTagger.json";
File wf = new File(WorkflowFactory.class.getProtectionDomain().getCodeSource().getLocation().getPath());
String wfpath = wf.getParentFile().getPath();
Workflow workflow = new Workflow(wfpath);
workflow.appendPlainTextProcessor(new SentenceSegmentor(), null);
workflow.appendPlainTextProcessor(new InformalSentenceFilter(), null);
workflow.setMorphAnalyzer(new ChartMorphAnalyzer(), chartMorphAnalyzerConf);
// TODO: Add workflow.setMorphUserDic(userDicFile);
workflow.appendMorphemeProcessor(new UnknownProcessor(), null);
switch (workflowFlag) {
case WORKFLOW_HMM_POS_TAGGER_09:
workflow.setPosTagger(new HMMTagger(), hmmTaggerAnalyzerConf);
workflow.appendPosProcessor(new SimplePOSResult09(), null);
break;
case WORKFLOW_HMM_POS_TAGGER_22:
workflow.setPosTagger(new HMMTagger(), hmmTaggerAnalyzerConf);
workflow.appendPosProcessor(new SimplePOSResult22(), null);
break;
case WORKFLOW_MORPH_ANALYZER:
break;
case WORKFLOW_NOUN_EXTRACTOR:
workflow.setPosTagger(new HMMTagger(), hmmTaggerAnalyzerConf);
workflow.appendPosProcessor(new NounExtractor(), null);
break;
}
return workflow;
}