/**
 * 
 */
package kr.ac.kaist.swrc.jhannanum.demo;

import kr.ac.kaist.swrc.jhannanum.hannanum.HanNanum;
import kr.ac.kaist.swrc.jhannanum.module.ma.MorphAnalyzer;
import kr.ac.kaist.swrc.jhannanum.module.sentence.SentenceSplitter;
import kr.ac.kaist.swrc.jhannanum.module.tagger.HMMTagger;
import kr.ac.kaist.swrc.jhannanum.module.unknown.UnknownProcessor;
import kr.ac.kaist.swrc.jhannanum.module.usn.USNProcessor;

/**
 * @author Sangwon Park (hudoni@world.kaist.ac.kr), CILab, SWRC, Kaist
 *
 */
public class WorkflowWithHMMTagger {

	public static void main(String[] args) {
		HanNanum han = new HanNanum();
    	
    	try {
    		/* Setting up the work flow */
    		han.addModule(new SentenceSplitter(), null);
			han.addModule(new MorphAnalyzer(), "data/morph.conf");
			han.addModule(new UnknownProcessor(), null);
			han.addModule(new USNProcessor(), null);
			han.addModule(new HMMTagger(), null);
			
			/* Activating the work flow */
			han.activateWorkflow();
			
			/* Analysis using the work flow */
			String test = null;

			test = "프로젝트 전체 회의\n"
				 + "회의 일정은 다음과 같습니다.\n";
			System.out.println(han.analyze(test));
			
			test = "日時: 2010년 7월 30일 오후 1시\n"
				 + "場所: Coex Conference Room\n";
			System.out.println(han.analyze(test));
			
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(0);
		}
		
		/* Shutdown the work flow */
		han.close();  	
	}
}
