public class Continuous extends HasMWEDetector implements IMWEDetectorFilter
Constructor and Description |
---|
Continuous(IMWEDetector d)
Constructs the detector from the given backing detector.
|
Modifier and Type | Method and Description |
---|---|
<T extends IToken> |
detect(java.util.List<T> sentence)
Given a list of tokens, the detector searches for the MWEs in the list.
|
static <T extends IToken> |
isDiscontinuous(IMWE<T> mwe,
java.util.List<T> sentence)
Determines if the specified MWE is continuous, i.e., there are no
interstitial tokens inside its boundaries that are not a part of the MWE.
|
static <T extends IToken> |
isDiscontinuous(IMWE<T> mwe,
java.util.Map<T,java.lang.Integer> indexMap)
Determines if the specified MWE is continuous, i.e., there are no
interstitial tokens inside its boundaries that are not a part of the MWE.
|
getWrappedDetector
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getWrappedDetector
public Continuous(IMWEDetector d)
d
- the IMWEDetector that will be used to back this detector. May
not be null
.java.lang.NullPointerException
- if the backing detector is null
public <T extends IToken> java.util.List<IMWE<T>> detect(java.util.List<T> sentence)
IMWEDetector
IMWE
objects representing these
multi-word expressions. The method returns an empty list if no MWEs are
found; the method should never return null
.detect
in interface IMWEDetector
detect
in class HasMWEDetector
T
- the type of the tokens in the sentencesentence
- a sentence which the detector should search for multi-word
expressions.IMWE
objects representing the multi-word
expressions found in the sentence. Returns an empty list if no
multi-word expressions are found; never returns null
public static <T extends IToken> boolean isDiscontinuous(IMWE<T> mwe, java.util.List<T> sentence)
T
- the token type of the MWEmwe
- the MWE in question, may not be null
sentence
- the sentence from which the MWE is drawntrue
if the MWE is continuous; false
otherwise.java.lang.NullPointerException
- if the specified mwe is null
, or does not come
from the specified sentencepublic static <T extends IToken> boolean isDiscontinuous(IMWE<T> mwe, java.util.Map<T,java.lang.Integer> indexMap)
T
- the token type of the MWEmwe
- the MWE in question, may not be null
indexMap
- a map from sentence tokens to their index in the sentencetrue
if the MWE is continuous; false
otherwise.java.lang.NullPointerException
- if the specified mwe is null
Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.