/** * 용언 + '음/기' + 조사(PTN_VMXMJ) * * @param o the analyzed output * @param candidates candidates * @throws MorphException throw exception */ public static boolean analysisVMJ(AnalysisOutput o, List<AnalysisOutput> candidates) throws MorphException { String[] irrs = IrregularUtil.restoreIrregularVerb(o.getStem(), o.getElist().get(0)); if (irrs != null) { o.setStem(irrs[0]); o.setElist(irrs[1], 0); } if (DictionaryUtil.getVerb(o.getStem()) != null) { o.setPatn(PatternConstants.PTN_VMJ); o.setPos(PatternConstants.POS_VERB); o.setScore(AnalysisOutput.SCORE_CORRECT); candidates.add(o); return true; } return false; }
/** * 용언 + '아/어' + 보조용언 + '음/기' + 조사(PTN_VMXMJ) * * @param o the analyzed output * @param candidates candidates * @throws MorphException throw exception */ public static boolean analysisVMXMJ(AnalysisOutput o, List<AnalysisOutput> candidates) throws MorphException { int idxXVerb = VerbUtil.endsWithXVerb(o.getStem()); if (idxXVerb != -1) { // 2. 사랑받아보다 String eogan = o.getStem().substring(0, idxXVerb); o.setXverb(o.getStem().substring(idxXVerb)); String[] stomis = null; if (eogan.endsWith("아") || eogan.endsWith("어")) stomis = EomiUtil.splitEomi( eogan.substring(0, eogan.length() - 1), eogan.substring(eogan.length() - 1)); else stomis = EomiUtil.splitEomi(eogan, ""); if (stomis[0] == null) return false; String[] irrs = IrregularUtil.restoreIrregularVerb(stomis[0], stomis[1]); if (irrs != null) { o.setStem(irrs[0]); o.addElist(irrs[1]); } else { o.setStem(stomis[0]); o.addElist(stomis[1]); } if (DictionaryUtil.getVerb(o.getStem()) != null) { o.setPatn(PatternConstants.PTN_VMXMJ); o.setPos(PatternConstants.POS_VERB); o.setScore(AnalysisOutput.SCORE_CORRECT); candidates.add(o); return true; } else if (analysisNSMXMJ(o, candidates)) { return true; } } return false; }