Details
-
New Feature
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
future enhancement
-
None
Description
There are two types that are consistently used together: EventMention and EntityMention. These are both subtypes of IdentifiedAnnotation. The code for a dozens of annotators and writers is thus:
Collection<IdentifiedAnnotation> annotations = JCasUtil.select( JCas, IdentifiedAnnotation.class);
Collection<IdentifiedAnnotation> wantedAnnotations =
for ( annotations)
{ if ( instanceof EventMention | EntityMention ) \{ wantedAnnotations.add() }}
The first call to JCasUtil iterates through the entire FS, then the second call iterates through the returned sublist.
This would be much more efficient if there were one appropriate parent type that could be returned from the first call, for instance a generic "Mention" type.
True, at this point there isn't a single method that can apply to both mention children and this may be poor OOD, but since they are "types" and not "classes" and since it would add efficiency and clarity throughout the code I think that it is worthwhile.