private static final String HACER_TIME_FORM = "(?i)^(?:hac(?:er|ía))$";
@SuppressWarnings("unchecked")
private void buildAnnotations() {
// +.25 F1
annotations.put("-markInf", new Pair("/^(S|grup\\.verb|infinitiu|gerundi)/ < @infinitiu",
new SimpleStringFunction("-infinitive")));
annotations.put("-markGer", new Pair("/^(S|grup\\.verb|infinitiu|gerundi)/ < @gerundi",
new SimpleStringFunction("-gerund")));
// +.04 F1
annotations.put("-markRelative", new Pair("@S <, @relatiu",
new SimpleStringFunction("-relative")));
// Negative F1; unused in default config
annotations.put("-markPPHeads", new Pair("@sp",
new AnnotateHeadFunction(headFinder)));
// +.1 F1
annotations.put("-markComo", new Pair("@cs < /(?i)^como$/",
new SimpleStringFunction("[como]")));
annotations.put("-markSpecHeads", new Pair("@spec", new AnnotateHeadFunction(headFinder)));
// +.32 F1
annotations.put("-markSingleChildNPs", new Pair("/^(sn|grup\\.nom)/ <: __",
new SimpleStringFunction("-singleChild")));
// +.05 F1
annotations.put("-markPPFriendlyVerbs", new Pair("/^v/ > /^grup\\.prep/",
new SimpleStringFunction("-PPFriendly")));
// +.46 F1
annotations.put("-markConjTypes", new Pair("@conj <: /^c[cs]/=c", new MarkConjTypeFunction()));
// +.09 F1
annotations.put("-markPronounNPs", new Pair("/^(sn|grup\\.nom)/ <<: /^p[0p]/",
new SimpleStringFunction("-pronoun")));
// +1.39 F1
annotations.put("-markParticipleAdjs", new Pair(
"@aq0000 < /(?i)([aeií]d|puest|biert|vist|(ben|mal)dit|[fh]ech|scrit|muert|[sv]uelt|[rl]ect|"
+ "frit|^(rot|dich|impres|desnud|sujet|exent))[oa]s?$/",
new SimpleStringFunction("-part")));
// Negative F1; unused in default config
annotations.put("-markSentenceInitialClauses", new Pair("@S !, __",
new SimpleStringFunction("-init")));
// Insignificant F1; unused in default config
annotations.put("-markPoder", new Pair(
String.format("/^(infinitiu|gerundi|grup\\.verb)/ <<: /%s/", PODER_FORM),
new SimpleStringFunction("-poder")));
// +.29 F1
annotations.put("-markBaseNPs", new Pair("/^grup\\.nom/ !< (__ < (__ < __))",
new SimpleStringFunction("-base")));
// +.17 F1
annotations.put("-markVerbless", new Pair("@S|sentence !<< /^(v|participi$)/",
new SimpleStringFunction("-verbless")));
// +.23 F1
annotations.put("-markDominatesVerb", new Pair("__ << (/^(v|participi$)/ < __)",
new SimpleStringFunction("-dominatesV")));
// Negative F1 -- not used by default
annotations.put("-markNonRecSPs", new Pair("@sp !<< @sp", new SimpleStringFunction("-nonRec")));
// In right-recursive verb phrases, mark the prefix of the first verb on its tag.
// This annotation tries to capture the fact that only a few roots are ever really part of
// these constructions: poder, deber, ir, etc.
annotations.put("-markRightRecVPPrefixes",
new Pair("/^v/ $+ @infinitiu|gerundi >, /^(grup.verb|infinitiu|gerundi)/",
new MarkPrefixFunction(3)));
// Negative F1 -- not used by default
annotations.put("-markParentheticalNPs", new Pair("@sn <<, fpa <<` fpt",
new SimpleStringFunction("-paren")));
annotations.put("-markNumericNPs", new Pair("@sn << (/^z/ < __) !<< @sn",
new SimpleStringFunction("-num")));
// Negative F1 -- not used by default
annotations.put("-markCoordinatedNPs", new Pair(
"@sn <, (/^(sn|grup\\.nom)/ $+ (@conj < /^(cc|grup\\.cc)/ $+ /^(sn|grup\\.nom)/=last))" +
"<` =last",
new SimpleStringFunction("-coord")));
annotations.put("-markHacerTime", new Pair(
String.format("/^vm/ < /%s/ $+ /^d/", HACER_TIME_FORM),
new SimpleStringFunction("-hacerTime")));
compileAnnotations(headFinder);
}