public class LMLR extends HasMWEDetector implements IMWEDetectorResolver
| Constructor and Description |
|---|
LMLR(IMWEDetector detector)
Constructs the detector from the backing detector.
|
| Modifier and Type | Method and Description |
|---|---|
<T extends IToken> |
detect(java.util.List<T> s)
Given a list of tokens, the detector searches for the MWEs in the list.
|
static <T extends IToken> |
getFirstToken(java.lang.Iterable<? extends T> tokens,
java.util.Comparator<T> c)
Returns the token that is the first in a given iterable collection of
tokens.
|
static <T extends IToken> |
longest(IMWE<T> one,
IMWE<T> two,
java.util.Comparator<T> c)
Compares two MWEs and returns the longest MWE.
|
getWrappedDetectorclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetWrappedDetectorpublic LMLR(IMWEDetector detector)
null.detector - the detector used to back this detector.public <T extends IToken> java.util.List<IMWE<T>> detect(java.util.List<T> s)
IMWEDetectorIMWE 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 IMWEDetectordetect in class HasMWEDetectorT - the type of the tokens in the sentences - 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 nullpublic static <T extends IToken> T getFirstToken(java.lang.Iterable<? extends T> tokens, java.util.Comparator<T> c)
T - the type of tokens being comparedtokens - the tokens being comparedc - the comparator used to determine if one token comes before
anotherpublic static <T extends IToken> IMWE<T> longest(IMWE<T> one, IMWE<T> two, java.util.Comparator<T> c)
T - the type of tokens in the MWEone - the first MWEtwo - the second MWEc - the comparator to useCopyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.