// print out totals:
for(String typeId : typeCounts.keySet()){
String featName = "arg1EntityTypeID_"+typeId;
arg1Types.add(featName);
features.add(new Feature(featName, typeCounts.get(typeId)));
}
// TO print out just the types without counts:
// for(String typeId : typeCounts.keySet()){
// features.add(new Feature("arg1EntityTypeID_", typeId));
// }
// TODO: this is the correct implementatino, but it does not perform as well
// for(int typeID : uniqueTypeIDs) {
// features.add(new Feature("arg1EntityTypeID", String.valueOf(typeID)));
// }
}
if(arg2 instanceof EventMention){
CounterMap<String> typeCounts =
getMentionTypes(JCasUtil.selectCovering(systemView, EventMention.class, arg2.getBegin(), arg2.getEnd()));
// print out totals:
for(String typeId : typeCounts.keySet()){
String featName = "arg2EntityTypeID_"+typeId;
arg2Types.add(featName);
features.add(new Feature(featName, typeCounts.get(typeId)));
}
}
if(arg1Types.size() == 0) arg1Types.add("arg1NotUMLS");
if(arg2Types.size() == 0) arg2Types.add("arg2NotUMLS");
for(String arg1Type : arg1Types){
for(String arg2Type : arg2Types){
features.add(new Feature("ArgPair-" + arg1Type + "_" + arg2Type));
}
}
return features;
}