edu.mit.jmwe.harness.result.error
Class DetectorDisagreement

java.lang.Object
  extended by edu.mit.jmwe.harness.result.error.AbstractErrorDetector
      extended by edu.mit.jmwe.harness.result.error.DetectorDisagreement
All Implemented Interfaces:
IHasID, IErrorDetector

public class DetectorDisagreement
extends AbstractErrorDetector

Counts and stores those MWEs that were not found by the backing detector. Used to identify those MWEs that two detectors disagree on.

Since:
jMWE 1.0.0
Version:
$Id: DetectorDisagreement.java 615 2011-05-07 00:02:36Z markaf $
Author:
N. Kulkarni

Field Summary
protected  IMWEDetector d
           
static String ID
          The ID for this error detector, "edu.mit.jmwe.error.Disagree"
 
Constructor Summary
DetectorDisagreement(IMWEDetector d)
          Constructs a new error detector that uses the specified MWE detector for backing.
 
Method Summary
<T extends IToken,S extends IMarkedSentence<T>>
IErrorResult<T>
detect(ISentenceResult<T,S> result)
          Identifies the multi-word expressions in a unit result that fall under the specific error class this detector identifies.
 IMWEDetector getDetector()
          Returns the MWE detector for this error detector.
static
<T extends IToken,S extends IMarkedSentence<T>>
boolean
isProblem(IMWE<T> mwe, ISentenceResult<T,S> result, IMWEDetector detector)
          Determines if the specified MWE is a problem relative to the specified sentence according to this error class.
 
Methods inherited from class edu.mit.jmwe.harness.result.error.AbstractErrorDetector
getID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
The ID for this error detector, "edu.mit.jmwe.error.Disagree"

Since:
jMWE 1.0.0
See Also:
Constant Field Values

d

protected final IMWEDetector d
Constructor Detail

DetectorDisagreement

public DetectorDisagreement(IMWEDetector d)
Constructs a new error detector that uses the specified MWE detector for backing.

Parameters:
d - the detector used by this error detector
Throws:
NullPointerException - if the specified detector is null
Since:
jMWE 1.0.0
Method Detail

getDetector

public IMWEDetector getDetector()
Returns the MWE detector for this error detector.

Returns:
the MWE detector for this error detector, never null
Since:
jMWE 1.0.0

detect

public <T extends IToken,S extends IMarkedSentence<T>> IErrorResult<T> detect(ISentenceResult<T,S> result)
Description copied from interface: IErrorDetector
Identifies the multi-word expressions in a unit result that fall under the specific error class this detector identifies.

Type Parameters:
T - the type of tokens contained in the unit.
S - the type of marked sentence whose results are stored. Is parameterized by tokens of type T.
Parameters:
result - the sentence result obtained by running an IMWEDetector over a unit
Returns:
an error result containing the MWEs identified by this error detector

isProblem

public static <T extends IToken,S extends IMarkedSentence<T>> boolean isProblem(IMWE<T> mwe,
                                                                                ISentenceResult<T,S> result,
                                                                                IMWEDetector detector)
Determines if the specified MWE is a problem relative to the specified sentence according to this error class.

Type Parameters:
T - the token type of the MWE
Parameters:
mwe - the MWE in question, may not be null
Returns:
true if the MWE is a problem; false otherwise.
Throws:
NullPointerException - if the specified mwe is null
Since:
jMWE 1.0.0


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