static final TregexPattern tregexMonthYear = TregexPatternCompiler.defaultCompiler.compile("NP=root <1 (NP <: (NNP=month <: /" + MONTH_REGEX + "/)) <2 (NP=yearnp <: (CD=year <: __)) : =root <- =yearnp");
static final TregexPattern tregexMonthDayYear = TregexPatternCompiler.defaultCompiler.compile("NP=root <1 (NP=monthdayroot <1 (NNP=month <: /" + MONTH_REGEX +"/) <2 (CD=day <: __)) <2 (/^,$/=comma <: /^,$/) <3 (NP=yearroot <: (CD=year <: __)) : (=root <- =yearroot) : (=monthdayroot <- =day)");
public Tree transformTree(Tree t) {
TregexMatcher matcher = tregexMonthYear.matcher(t);
while (matcher.find()) {
Tree root = matcher.getNode("root");
Tree month = matcher.getNode("month");
Tree year = matcher.getNode("year");
Tree[] children = new Tree[] {month, year};
root.setChildren(children);