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

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

public class ExtraPrep
extends AbstractErrorDetector

Finds the proper noun multi-word expressions that were truncated incorrectly because of a token with a prepositional tag. For example:

 He-NN lives-VB in-IN the-DT United-PRP States-PRP of-IN America-PRP.
 
The detector might only return United States;P instead of the correct United_States_of_America;P.

Since:
jMWE 1.0.0
Version:
$Id: ExtraPrep.java 639 2011-09-26 21:03:51Z markaf $
Author:
N. Kulkarni

Field Summary
static String ID
          The ID for this error detector, "edu.mit.jmwe.error.ExtraPrep"
 
Constructor Summary
protected ExtraPrep()
          This constructor is marked protected so that this class may be subclassed, but not directly instantiated.
 
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.
protected static
<T extends IToken>
int
findTag(IMWE<T> test, String tag)
          Returns the index of the first token in the MWE with the specified tag.
static ExtraPrep getInstance()
          Returns the singleton instance of this class, instantiating if necessary.
 
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.ExtraPrep"

Since:
jMWE 1.0.0
See Also:
Constant Field Values
Constructor Detail

ExtraPrep

protected ExtraPrep()
This constructor is marked protected so that this class may be subclassed, but not directly instantiated.

Since:
jMWE 1.0.0
Method Detail

getInstance

public static ExtraPrep getInstance()
Returns the singleton instance of this class, instantiating if necessary.

Returns:
the singleton instance of this class
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

findTag

protected static <T extends IToken> int findTag(IMWE<T> test,
                                                String tag)
Returns the index of the first token in the MWE with the specified tag. If no tokens have this tag, returns -1.

Type Parameters:
T - the type of tokens in the MWE
Parameters:
test - the MWE whose tokens will be searched
tag - the tag being searched for
Returns:
the index of the first token in the MWE with the specified tag. If no tokens have this tag, returns -1.
Since:
jMWE 1.0.0


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