TokenNameFinderEvaluator extends Evaluator<NameSample> { public FMeasure getFMeasure() { return fmeasure; } TokenNameFinderEvaluator(TokenNameFinder nameFinder, TokenNameFinderEvaluationMonitor ... listeners); FMeasure getFMeasure(); @Deprecated static void main(String[] args);  }
@Test public void testPositive() { OutputStream stream = new ByteArrayOutputStream(); TokenNameFinderEvaluationMonitor listener = new NameEvaluationErrorListener(stream); Span[] pred = createSimpleNameSampleA().getNames(); TokenNameFinderEvaluator eval = new TokenNameFinderEvaluator(new DummyNameFinder(pred), listener); eval.evaluateSample(createSimpleNameSampleA()); assertEquals(1.0, eval.getFMeasure().getFMeasure()); assertEquals(0, stream.toString().length()); }
@Test public void testNegative() { OutputStream stream = new ByteArrayOutputStream(); TokenNameFinderEvaluationMonitor listener = new NameEvaluationErrorListener(stream); Span[] pred = createSimpleNameSampleB().getNames(); TokenNameFinderEvaluator eval = new TokenNameFinderEvaluator(new DummyNameFinder(pred), listener); eval.evaluateSample(createSimpleNameSampleA()); assertEquals(0.8, eval.getFMeasure().getFMeasure()); assertNotSame(0, stream.toString().length()); }