private Event getBaseNPHistory(ModifierEvent modEvent, int backOffLevel) { MutableEvent hist = histories[backOffLevel]; Symbol side = Constants.sideToSym(modEvent.side()); Symbol prevModLabel = (modEvent.previousMods().get(0) == startSym ? modEvent.head() : modEvent.previousMods().symbolAt(0)); Word prevModWord = (modEvent.previousWords().getWord(0).equals(startWord) ? modEvent.headWord() : modEvent.previousWords().getWord(0)); hist.clear(); switch (backOffLevel) { case 0: // for p(t_i | M_i, P, M(w,t)_i-1, side) hist.add(modEvent.modifier()); hist.add(Language.training().removeGapAugmentation(modEvent.parent())); hist.add(prevModLabel); hist.add(prevModWord.word()); hist.add(prevModWord.tag()); hist.add(side); break; case 1: // for p(t_i | M_i, P, M(t)_i-1, side) hist.add(modEvent.modifier()); hist.add(Language.training().removeGapAugmentation(modEvent.parent())); hist.add(prevModLabel); hist.add(prevModWord.tag()); hist.add(side); break; case 2: // for p(t_i | M_i, P, M_i-1, side) hist.add(modEvent.modifier()); hist.add(Language.training().removeGapAugmentation(modEvent.parent())); hist.add(prevModLabel); hist.add(side); break; /* case 3: // for p(t_i | M_i, P) hist.add(modEvent.modifier()); hist.add(Language.training().removeGapAugmentation(modEvent.parent())); break; */ } return hist; }