T
- the type of tokens that form the multi-word expressions stored in
this resultpublic class ErrorResult<T extends IToken> extends java.lang.Object implements IErrorResult<T>
IErrorResult
interface.Modifier and Type | Class and Description |
---|---|
static class |
ErrorResult.ErrorResultBuilder<T extends IToken>
An object that builds an error result.
|
Constructor and Description |
---|
ErrorResult(java.util.Map<java.lang.String,java.util.List<IMWE<T>>> details)
Constructs the error result from a map that stores MWEs under the ID of
the error class that they belong to.
|
ErrorResult(java.util.Map<java.lang.String,java.util.List<IMWE<T>>> details,
boolean reallocate)
Constructs the error result from a
Map that stores multi-word
expressions under the ID of the error class that they belong to.This
constructor may or may not allocate a new internal map, depending on the
value of the reallocation flag. |
ErrorResult(java.lang.String errorID,
java.util.List<IMWE<T>> errors)
Constructs the error result that stores the given multi-word expressions
under the given ID of the error class that they belong to.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.util.List<IMWE<T>>> |
getDetails()
Returns a
Map that stores multi-word expressions under the ID of
the error class they belong to. |
int |
getNumErrors(java.lang.String errorID)
Gets the number of MWEs that fall under the given error class.
|
int |
getTotalErrors()
Returns the total number of errors for the result.
|
java.lang.String |
toString() |
static <T extends IToken> |
toString(IErrorResult<T> result)
Creates a table displaying the number of instances of each error class.
|
public ErrorResult(java.lang.String errorID, java.util.List<IMWE<T>> errors)
errors
- a non-null list of error multi-word expressionserrorID
- the ID of the error class that the multi-word expressions
belong tojava.lang.NullPointerException
- if the multi-word expression list is null
.public ErrorResult(java.util.Map<java.lang.String,java.util.List<IMWE<T>>> details)
details
- a non-null map that stores multi-word expressions under the ID
of the error class that they belong to.java.lang.NullPointerException
- if the map is null
.public ErrorResult(java.util.Map<java.lang.String,java.util.List<IMWE<T>>> details, boolean reallocate)
Map
that stores multi-word
expressions under the ID of the error class that they belong to.This
constructor may or may not allocate a new internal map, depending on the
value of the reallocation flag. If no reallocation is requested, this
constructor reuses the given map, and so subsequent changes to the source
list will affect this object.details
- a non-null map that stores multi-word expressions under the ID
of the error class that they belong to.reallocate
- If true, will allocate a new internal map for detailsjava.lang.NullPointerException
- if the map is null
.public java.util.Map<java.lang.String,java.util.List<IMWE<T>>> getDetails()
IErrorResult
Map
that stores multi-word expressions under the ID of
the error class they belong to. Should never be null
.getDetails
in interface IErrorResult<T extends IToken>
Map
that stores multi-word expressions under
the ID of the error class they belong to.public int getTotalErrors()
IErrorResult
getTotalErrors
in interface IErrorResult<T extends IToken>
public int getNumErrors(java.lang.String errorID)
IErrorResult
getNumErrors
in interface IErrorResult<T extends IToken>
errorID
- the ID of the error class.public java.lang.String toString()
toString
in class java.lang.Object
public static <T extends IToken> java.lang.String toString(IErrorResult<T> result)
T
- the type of tokens that form the multi-word expressions stored
in this resultresult
- a non-null error resultCopyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.