edu.mit.jmwe.harness.result.error
Class CompositeErrorDetector
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<IErrorDetector>
edu.mit.jmwe.harness.result.error.CompositeErrorDetector
- All Implemented Interfaces:
- IHasID, IErrorDetector, Iterable<IErrorDetector>, Collection<IErrorDetector>, List<IErrorDetector>
- Direct Known Subclasses:
- CommonErrorDetector
public class CompositeErrorDetector
- extends AbstractList<IErrorDetector>
- implements IErrorDetector
Error detectors extending this class are composed of multiple simpler error
detectors.
- Since:
- jMWE 1.0.0
- Version:
- $Id: CompositeErrorDetector.java 615 2011-05-07 00:02:36Z markaf $
- Author:
- N. Kulkarni
Field Summary |
static String |
ID
The ID for this error detector, "edu.mit.jmwe.error.composite" |
Method Summary |
|
detect(ISentenceResult<T,S> result)
Identifies the multi-word expressions in a unit result that fall under
the specific error class this detector identifies. |
IErrorDetector |
get(int index)
|
String |
getID()
Returns an ID string that uniquely identifies this object or object type. |
int |
size()
|
Methods inherited from class java.util.AbstractList |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
ID
public static final String ID
- The ID for this error detector, "edu.mit.jmwe.error.composite"
- Since:
- jMWE 1.0.0
- See Also:
- Constant Field Values
CompositeErrorDetector
public CompositeErrorDetector(IErrorDetector... detectors)
- Constructs a composite error detector from an array of error detectors.
- Parameters:
detectors
- the array of error detectors. May not be null
.
- Throws:
NullPointerException
- if the list of error detectors is null
or
contains null
IllegalArgumentException
- if the specified array is empty- Since:
- jMWE 1.0.0
CompositeErrorDetector
public CompositeErrorDetector(List<? extends IErrorDetector> detectors)
- Constructs a composite error detector from a list of error detectors.
- Parameters:
detectors
- the list of error detectors. May not be null
.
- Throws:
NullPointerException
- if the list of error detectors is null
- Since:
- jMWE 1.0.0
getID
public String getID()
- Description copied from interface:
IHasID
- Returns an ID string that uniquely identifies this object or object type.
Should never return
null
.
- Specified by:
getID
in interface IHasID
- Returns:
- the non-null id String
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.
- Specified by:
detect
in interface IErrorDetector
- 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
get
public IErrorDetector get(int index)
- Specified by:
get
in interface List<IErrorDetector>
- Specified by:
get
in class AbstractList<IErrorDetector>
size
public int size()
- Specified by:
size
in interface Collection<IErrorDetector>
- Specified by:
size
in interface List<IErrorDetector>
- Specified by:
size
in class AbstractCollection<IErrorDetector>
Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.