I'm not familiar with the decisions behind ProcedureMethod, but modeling after
this fragment of code
} else if ("method_class".equals(annotation.type)) {
String code = stringSlots.remove("associatedCode");
ProcedureMethod method = new ProcedureMethod(jCas);
method.setValue(code);
ProcedureMethodModifier modifier = new ProcedureMethodModifier(jCas,
coveringSpan.begin, coveringSpan.end);
modifier.setNormalizedForm(method);
I would have picked (2)
I'm also a little nervous about (3).
Hopefully someone else will chime in.
-- James
> -----Original Message-----
> From: ctakes-dev-return-1206-Masanz.James=mayo....@incubator.apache.org
> [mailto:ctakes-dev-return-1206-Masanz.James=mayo....@incubator.apache.org]
> On Behalf Of Steven Bethard
> Sent: Thursday, February 14, 2013 2:27 PM
> To: [email protected]
> Subject: SHARPKnowtatorXMLReader and new type system
>
> 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