|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.mit.jmwe.detect.HasMWEDetector
edu.mit.jmwe.detect.Continuous
public class Continuous
A detector that filters the results of its backing detector to return only those MWEs whose parts are continuous in the sentence.
Constructor Summary | |
---|---|
Continuous(IMWEDetector d)
Constructs the detector from the given backing detector. |
Method Summary | ||
---|---|---|
|
detect(List<T> sentence)
Given a list of tokens, the detector searches for the MWEs in the list. |
|
static
|
isDiscontinuous(IMWE<T> mwe,
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
|
isDiscontinuous(IMWE<T> mwe,
Map<T,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. |
Methods inherited from class edu.mit.jmwe.detect.HasMWEDetector |
---|
getWrappedDetector |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface edu.mit.jmwe.detect.IHasMWEDetector |
---|
getWrappedDetector |
Constructor Detail |
---|
public Continuous(IMWEDetector d)
d
- the IMWEDetector that will be used to back this detector. May
not be null.
NullPointerException
- if the backing detector is nullMethod Detail |
---|
public <T extends IToken> List<IMWE<T>> detect(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, 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 drawn
true
if the MWE is continuous; false
otherwise.
NullPointerException
- if the specified mwe is null
, or does not come
from the specified sentencepublic static <T extends IToken> boolean isDiscontinuous(IMWE<T> mwe, Map<T,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 sentence
true
if the MWE is continuous; false
otherwise.
NullPointerException
- if the specified mwe is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |