Komoran implements Cloneable { public void setUserDic(String userDic) { try { this.userDic = new Observation(); BufferedReader br = new BufferedReader(new FileReader(userDic)); String line; while ((line = br.readLine()) != null) { line = line.trim(); if (line.length() == 0 || line.charAt(0) == '#') continue; int lastIdx = line.lastIndexOf("\t"); String morph; String pos; if (lastIdx == -1) { morph = line.trim(); pos = "NNP"; } else { morph = line.substring(0, lastIdx); pos = line.substring(lastIdx + 1); } this.userDic.put(morph, pos, this.resources.getTable().getId(pos), 0.0); } br.close(); this.userDic.getTrieDictionary().buildFailLink(); } catch (Exception e) { e.printStackTrace(); } } Komoran(String modelPath);  Komoran(DEFAULT_MODEL modelType); void analyzeTextFile(String inputFilename, String outputFilename, int thread); List<KomoranResult> analyze(List<String> sentences, int thread); KomoranResult analyze(String sentence); double scoreDebug(List<String> analyzeResultList, List<String> analyzePosList); List<KomoranResult> analyze(String sentence, int nbest); void setFWDic(String filename); void setUserDic(String userDic);  }
@Test public void setUserDic() { this.komoran.setUserDic("user_data/dic.user"); System.out.println(this.komoran.analyze("2010년 아시안 게임 사격 남자 10m 공기 권총").getPlainText()); System.out.println(this.komoran.analyze("눈이 자꾸 흘렀다.").getPlainText()); System.out.println(this.komoran.analyze("싸이는 가수다").getPlainText()); System.out.println(this.komoran.analyze("센트롤이").getPlainText()); System.out.println(this.komoran.analyze("센트롤이").getTokenList()); System.out.println(this.komoran.analyze("감싼").getTokenList()); System.out.println(this.komoran.analyze("싸").getTokenList()); System.out.println(this.komoran.analyze("난").getTokenList()); System.out.println(this.komoran.analyze("밀리언 달러 베이비랑").getTokenList()); System.out.println(this.komoran.analyze("밀리언 달러 베이비랑 바람과 함께 사라지다랑 뭐가 더 재밌었어?").getTokenList()); }