List<Predicate> preds = JCasUtil.selectCovered(Predicate.class, arg1);
if(preds.size() > 0){
feats.add(new Feature("Arg1_Pred", true));
feats.add(new Feature("Arg1_Frame", preds.get(0).getFrameSet()));
// check if arg2 is one of its SRL args
FSList relList = preds.get(0).getRelations();
while(relList instanceof NonEmptyFSList){
SemanticRoleRelation rel = (SemanticRoleRelation) ((NonEmptyFSList)relList).getHead();
SemanticArgument arg = rel.getArgument();
if(arg.getBegin() == arg2.getBegin() && arg.getEnd() == arg2.getEnd()){
feats.add(new Feature("Arg1_Pred_Arg2_Role", true));
break;
}
relList = ((NonEmptyFSList)relList).getTail();
}
}
List<SemanticArgument> args = JCasUtil.selectCovered(SemanticArgument.class, arg1);
if(args.size() > 0){
feats.add(new Feature("Arg1_SemArg", true));
feats.add(new Feature("Arg1_SemArgType", args.get(0).getLabel()));
}
}
if(arg2 instanceof EventMention){
List<Predicate> preds = JCasUtil.selectCovered(Predicate.class, arg2);
if(preds.size() > 0){
feats.add(new Feature("Arg2_Pred", true));
feats.add(new Feature("Arg2_Frame", preds.get(0).getFrameSet()));
// check if arg2 is one of its SRL args
FSList relList = preds.get(0).getRelations();
while(relList instanceof NonEmptyFSList){
SemanticRoleRelation rel = (SemanticRoleRelation) ((NonEmptyFSList)relList).getHead();
SemanticArgument arg = rel.getArgument();
if(arg.getBegin() == arg1.getBegin() && arg.getEnd() == arg1.getEnd()){
feats.add(new Feature("Arg2_Pred_Arg1_Role", true));