I was looking again at SHARPKnowtatorXMLReader, and I have some questions about
how annotations should be loaded now that we have things like
BodyLateralityModifier, ProcedureMethodModifier, etc. in the type system.
Specifically, what should we be doing with the normalized form?
Take for example, procedure methods. In the annotations, each "method_class"
(procedure method) has an "associatedCode" string attribute. Should
SHARPKnowtatorXMLReader
(1) Just set the associated code on the modifier directly:
String code = stringSlots.remove("associatedCode");
ProcedureMethodModifier modifier = new ProcedureMethodModifier(jCas,
coveringSpan.begin, coveringSpan.end);
modifier.setValue(code);
(2) Create an appropriate Attribute subclass, set the associated code there,
and set the Attribute as the modifier's normalized form:
String code = stringSlots.remove("associatedCode");
ProcedureMethodModifier modifier = new ProcedureMethodModifier(jCas,
coveringSpan.begin, coveringSpan.end);
ProcedureMethod method = new ProcedureMethod(jCas);
method.setValue(code);
modifier.setNormalizedForm(method);
(3) Both?
String code = stringSlots.remove("associatedCode");
ProcedureMethodModifier modifier = new ProcedureMethodModifier(jCas,
coveringSpan.begin, coveringSpan.end);
modifier.setValue(code);
ProcedureMethod method = new ProcedureMethod(jCas);
method.setValue(code);
modifier.setNormalizedForm(method);
I lean towards (3), but the duplication makes me a little nervous, like maybe
I'm doing something wrong.
Steve