public static Annotation getHeadVerb( Annotation verb, Map<String, AnnotationSet> annotations, String text) { AnnotationSet verbs = annotations.get(Constants.POS).getContained(verb); if (verbs == null || verbs.size() < 1) return verb; Annotation result = verbs.getFirst(); for (Annotation v : verbs) { if (!SyntaxUtils.isPreposition(v.getType())) { result = v; } } return result; }
@Override public String produceValue( Annotation np1, Annotation np2, Document doc, Map<Feature, String> featVector) { boolean sub = GramRole.getValue(np1, doc).equals("SUBJECT"); return sub && SyntaxUtils.isMainClause(np1, doc.getAnnotationSet(Constants.PARSE)) ? "Y" : "N"; }