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

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

public class InterstitialTokens
extends AbstractErrorDetector

Counts and stores the multi-word expressions that have tokens that are separated by one or more tokens in the sentence that are not also a part of the MWE.

Since:
jMWE 1.0.0
Version:
$Id: InterstitialTokens.java 607 2011-05-06 18:51:51Z nidhik $
Author:
N. Kulkarni

Field Summary
static String ID
          The ID for this error detector, "edu.mit.jmwe.error.Interstitial"
 
Constructor Summary
protected InterstitialTokens()
          This constructor is marked protected so that this class may be subclassed, but not directly instantiated.
 
Method Summary
<T extends IToken,U extends IMarkedSentence<T>>
IErrorResult<T>
detect(ISentenceResult<T,U> result)
          Identifies the multi-word expressions in a unit result that fall under the specific error class this detector identifies.
static InterstitialTokens getInstance()
          Returns the singleton instance of this class, instantiating if necessary.
static
<T extends IToken>
boolean
hasParticle(IMWE<T> mwe, List<T> sentence)
          Returns true if the given MWE contains a token that is a particle and is separated from the previous token in the MWE by one or more non-MWE tokens in the sentence.
static
<T extends IToken>
boolean
isParticle(T token)
          Returns true if the specified token is tagged as a particle; false otherwise
 
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.Interstitial"

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

InterstitialTokens

protected InterstitialTokens()
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 InterstitialTokens 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,U extends IMarkedSentence<T>> IErrorResult<T> detect(ISentenceResult<T,U> 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.
U - 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

isParticle

public static <T extends IToken> boolean isParticle(T token)
Returns true if the specified token is tagged as a particle; false otherwise

Type Parameters:
T - the type of the token to be checked
Parameters:
token - the token to be checked
Returns:
true if the specified token is tagged as a particle; false otherwise
Since:
jMWE 1.0.0

hasParticle

public static <T extends IToken> boolean hasParticle(IMWE<T> mwe,
                                                     List<T> sentence)
Returns true if the given MWE contains a token that is a particle and is separated from the previous token in the MWE by one or more non-MWE tokens in the sentence.

Type Parameters:
T - the type of tokens in the sentence
Parameters:
mwe - the MWE being checked
sentence - the sentence of which the MWE is a part
Returns:
true if the given MWE contains a token that is a particle and is separated from the previous token in the MWE by one or more non-MWE tokens in the sentence; false otherwise
Since:
jMWE 1.0.0


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