Right now, AnnotationStatistics only works with String outcomes. If we want it
to be able to work with other outcome types (e.g. Boolean), then we need to add
a type parameter. This should be pretty easy, except for this method:
public <ANNOTATION_TYPE extends Annotation> void add(
Collection<? extends ANNOTATION_TYPE> referenceAnnotations,
Collection<? extends ANNOTATION_TYPE> predictedAnnotations,
String outcomeFeatureName)
This is a convenience method that uses the annotation offsets as its "span",
and the value of the given feature as the "outcome". However, we don't know in
general how to convert a feature value to an OUTCOME_TYPE type. The only
solution I see is to replace the String parameter with a
Function<ANNOTATION_TYPE, OUTCOME_TYPE> parameter as is done in the 4 parameter
version of add. Then users would have to manually provide
AnnotationStatistics.annotationToFeatureValue(outcomeFeatureName) as the value
of this parameter.
Is it worth it to allow AnnotationStatistics to be used with any arbitrary
outcome type?
We need to decide before the 1.2 release, because AnnotationStatistics has not
been released yet, and this is probably our last chance to make a breaking
change.
Original issue reported on code.google.com by steven.b...@gmail.com on 31 Jul 2012 at 11:16
Original issue reported on code.google.com by
steven.b...@gmail.com
on 31 Jul 2012 at 11:16