edu.mit.jmwe.harness
Interface ITestHarness

All Known Implementing Classes:
TestHarness

public interface ITestHarness

Classes implementing this interface test an IMWEDetector by comparing the multi-word expressions it finds to those found in an IAnswerKey object. Calculates the precision and recall scores of the detector.

Since:
jMWE 1.0.0
Version:
$Id: ITestHarness.java 612 2011-05-06 20:22:54Z markaf $
Author:
M.A. Finlayson

Method Summary
<T extends IToken,S extends IMarkedSentence<T>>
void
run(IMWEDetector detector, IResultBuilder<T,S> results, Iterator<S> itr, IAnswerKey answers, IProgressBar pb)
          Runs the detector in the test harness and stores the results in the provided result builder.
<T extends IToken,S extends IMarkedSentence<T>>
void
run(Map<IMWEDetector,IResultBuilder<T,S>> detectors, Iterator<S> itr, IAnswerKey answers, IProgressBar pb)
          Runs the detectors in the test harness and stores the results in the associated result builder.
 

Method Detail

run

<T extends IToken,S extends IMarkedSentence<T>> void run(IMWEDetector detector,
                                                         IResultBuilder<T,S> results,
                                                         Iterator<S> itr,
                                                         IAnswerKey answers,
                                                         IProgressBar pb)
Runs the detector in the test harness and stores the results in the provided result builder.

Type Parameters:
T - the type of tokens in the IMarkedSentence objects the harness runs over
S - the type of unit the harness runs over. Is parameterized by tokens of type T.
Parameters:
detector - the detector being tested. May not be null
results - the builder in which the results should be stored; may not be null
itr - an iterator over the units the detector will be tested on. May not be null.
answers - an answer key that can be used to find the answer multi-word expressions in a unit. May not be null.
pb - a progress bar to which the harness should report progress. May be null
Throws:
NullPointerException - if the any of the detector, iterator or answer key are null
Since:
jMWE 1.0.0

run

<T extends IToken,S extends IMarkedSentence<T>> void run(Map<IMWEDetector,IResultBuilder<T,S>> detectors,
                                                         Iterator<S> itr,
                                                         IAnswerKey answers,
                                                         IProgressBar pb)
Runs the detectors in the test harness and stores the results in the associated result builder.

Type Parameters:
T - the type of tokens in the IMarkedSentence objects the harness runs over
S - the type of unit the harness runs over. Is parameterized by tokens of type T.
Parameters:
detectors - the detector-to-builder map being tested. May not be null
itr - an iterator over the units the detector will be tested on. May not be null.
answers - an answer key that can be used to find the answer multi-word expressions in a unit. May not be null.
pb - a progress bar to which the harness should report progress. May be null
Throws:
NullPointerException - if the any of the detector map, iterator, or answer key are null
Since:
jMWE 1.0.0


Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.