On Fri, Aug 19, 2011 at 6:11 AM, Jörn Kottmann <[email protected]> wrote:
> On 8/19/11 1:40 AM, [email protected] wrote: > >> ==============================**==============================** >> ================== >> --- incubator/opennlp/trunk/**opennlp-tools/src/main/java/** >> opennlp/tools/util/eval/**Evaluator.java (original) >> +++ incubator/opennlp/trunk/**opennlp-tools/src/main/java/** >> opennlp/tools/util/eval/**Evaluator.java Thu Aug 18 23:40:24 2011 >> @@ -19,7 +19,6 @@ >> package opennlp.tools.util.eval; >> >> import java.io.IOException; >> -import java.util.LinkedList; >> import java.util.List; >> >> import opennlp.tools.util.**ObjectStream; >> @@ -32,7 +31,15 @@ import opennlp.tools.util.**ObjectStream; >> */ >> public abstract class Evaluator<T> { >> >> - private List<EvaluationSampleListener<**T>> listeners = new >> LinkedList<**EvaluationSampleListener<T>>()**; >> + private List<EvaluationSampleListener<**T>> listeners; >> + >> + public Evaluator() { >> + this.listeners = null; >> + } >> + >> + public Evaluator(List<**EvaluationSampleListener<T>> listeners) { >> + this.listeners = listeners; >> + } >> > > I still believe that the case where you just have one > EvaluationSampleListener object that > should be hooked up is the most frequent use case, and its very rare that > people want to > hookup multiple. > > To make that easy, I suggest that we add a constructor which just takes one > listener. > Should we do it to all XYEvaluators or only with the Evaluator class? It is a lot of new constructors! And I now more and more feel like that we picked a bad name with > EvaluationSampleListener, > sounds a little confusing. Maybe EvaluationMonitor would be better, any > opinions? > Yes, sounds better. I will change if after the other refactorings.
