|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.mit.jmwe.index.HasMWEIndex
edu.mit.jmwe.detect.Exhaustive
public class Exhaustive
Implements an exhaustive algorithm that detects all possible non-stop-word
MWEs in a sentence, including MWEs that are out of order or discontinuous. A
"Stop Word MWE" is an MWE that consists of only stop words, as defined by the
set of strings returned by the getStopWords()
method.
To detect stop word MWEs, use the StopWords
or TrulyExhaustive
detectors.
Constructor Summary | |
---|---|
Exhaustive(IMWEIndex index)
Constructs the simple lookup detector from the given index of multi-word expressions. |
Method Summary | ||
---|---|---|
protected
|
containsDuplicate(Collection<? extends IMWE<T>> results,
IMWE<T> mwe)
Returns true if the given collection of MWEs already contains a particular MWE. |
|
|
detect(List<T> sentence)
Given a list of tokens, the detector searches for the MWEs in the list. |
|
protected Set<String> |
getStopWords()
Returns the stop words used by this detector. |
Methods inherited from class edu.mit.jmwe.index.HasMWEIndex |
---|
getMWEIndex |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Exhaustive(IMWEIndex index)
index
- An IMWEIndex that can be used by the detector to look up MWEs.
May not be null.
NullPointerException
- if the index 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
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 Set<String> getStopWords()
protected <T extends IToken> boolean containsDuplicate(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 for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |