public class Exhaustive extends HasMWEIndex implements IMWEDetector
getStopWords()
method.
To detect stop word MWEs, use the StopWords
or TrulyExhaustive
detectors.
Constructor and Description |
---|
Exhaustive(IMWEIndex index)
Constructs the simple lookup detector from the given index of multi-word
expressions.
|
Modifier and Type | Method and Description |
---|---|
protected <T extends IToken> |
containsDuplicate(java.util.Collection<? extends IMWE<T>> results,
IMWE<T> mwe)
Returns true if the given collection of MWEs already contains a
particular MWE.
|
<T extends IToken> |
detect(java.util.List<T> sentence)
Given a list of tokens, the detector searches for the MWEs in the list.
|
protected java.util.Set<java.lang.String> |
getStopWords()
Returns the stop words used by this detector.
|
getMWEIndex
public Exhaustive(IMWEIndex index)
index
- An IMWEIndex that can be used by the detector to look up MWEs.
May not be null
.java.lang.NullPointerException
- if the index 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
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
protected java.util.Set<java.lang.String> getStopWords()
protected <T extends IToken> boolean containsDuplicate(java.util.Collection<? extends IMWE<T>> results, IMWE<T> mwe)
T
- the type of tokens in the MWEsresults
- the collection to be checkedmwe
- the MWE being searched forCopyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.