public class InterstitialTokens extends AbstractErrorDetector
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID
The ID for this error detector, "edu.mit.jmwe.error.Interstitial"
|
Modifier | Constructor and Description |
---|---|
protected |
InterstitialTokens()
This constructor is marked protected so that this class may be
subclassed, but not directly instantiated.
|
Modifier and Type | Method and Description |
---|---|
<T extends IToken,U extends IMarkedSentence<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> |
hasParticle(IMWE<T> mwe,
java.util.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> |
isParticle(T token)
Returns
true if the specified token is tagged as a particle;
false otherwise |
getID
public static final java.lang.String ID
protected InterstitialTokens()
public static InterstitialTokens getInstance()
public <T extends IToken,U extends IMarkedSentence<T>> IErrorResult<T> detect(ISentenceResult<T,U> result)
IErrorDetector
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.result
- the sentence result obtained by running an IMWEDetector over a
unitpublic static <T extends IToken> boolean isParticle(T token)
true
if the specified token is tagged as a particle;
false
otherwiseT
- the type of the token to be checkedtoken
- the token to be checkedtrue
if the specified token is tagged as a particle;
false
otherwisepublic static <T extends IToken> boolean hasParticle(IMWE<T> mwe, java.util.List<T> sentence)
T
- the type of tokens in the sentencemwe
- the MWE being checkedsentence
- the sentence of which the MWE is a parttrue
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
otherwiseCopyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.