SeverityModifier.class));
} else if ("EVENT".equals(annotation.type)) {
// collect the event properties (setting defaults as necessary)
EventProperties eventProperties = new EventProperties(jCas);
eventProperties.setCategory(stringSlots.remove("type"));
if (eventProperties.getCategory() == null) {
eventProperties.setCategory("N/A");
}
eventProperties.setContextualModality(stringSlots.remove("contextualmoduality"));
if (eventProperties.getContextualModality() == null) {
eventProperties.setContextualModality("ACTUAL");
}
eventProperties.setContextualAspect(stringSlots.remove("contextualaspect"));
if (eventProperties.getContextualAspect() == null) {
eventProperties.setContextualAspect("N/A");
}
eventProperties.setDegree(stringSlots.remove("degree"));
if (eventProperties.getDegree() == null) {
eventProperties.setDegree("N/A");
}
eventProperties.setDocTimeRel(stringSlots.remove("DocTimeRel"));
if (eventProperties.getDocTimeRel() == null) {
LOGGER.warn(String.format(
"assuming docTimeRel=OVERLAP for annotation with id \"%s\"",
annotation.id));
eventProperties.setDocTimeRel("OVERLAP");
}
eventProperties.setPermanence(stringSlots.remove("permanence"));
if (eventProperties.getPermanence() == null) {
eventProperties.setPermanence("UNDETERMINED");
}
String polarityStr = stringSlots.remove("polarity");
int polarity;
if (polarityStr == null || polarityStr.equals("POS")) {
polarity = CONST.NE_POLARITY_NEGATION_ABSENT;
} else if (polarityStr.equals("NEG")) {
polarity = CONST.NE_POLARITY_NEGATION_PRESENT;
} else {
throw new IllegalArgumentException("Invalid polarity: " + polarityStr);
}
eventProperties.setPolarity(polarity);
// create the event object
Event event = new Event(jCas);
event.setConfidence(1.0f);
event.setDiscoveryTechnique(CONST.NE_DISCOVERY_TECH_GOLD_ANNOTATION);
// create the event mention
EventMention eventMention = new EventMention(jCas, coveringSpan.begin, coveringSpan.end);
eventMention.setConfidence(1.0f);
eventMention.setDiscoveryTechnique(CONST.NE_DISCOVERY_TECH_GOLD_ANNOTATION);
// add the links between event, mention and properties
event.setProperties(eventProperties);
event.setMentions(new FSArray(jCas, 1));
event.setMentions(0, eventMention);
eventMention.setEvent(event);
// add the annotations to the indexes
eventProperties.addToIndexes();
event.addToIndexes();
eventMention.addToIndexes();
idAnnotationMap.put(annotation.id, eventMention);
} else if ("DOCTIME".equals(annotation.type)) {