public class Consecutive extends HasMWEIndex implements IMWEDetector
Constructor and Description |
---|
Consecutive(IMWEIndex index)
Constructs the detector from the given index.
|
Modifier and Type | Method and Description |
---|---|
<T extends IToken> |
detect(java.util.List<T> sent)
Given a list of tokens, the detector searches for the MWEs in the list.
|
protected <T extends IToken> |
fillNextSlot(MWEBuilder<T> builder,
T t)
Fills the first non-null (empty) slot in the given builder.
|
protected java.util.Set<? extends IMWEDesc> |
getMWEDescs(IToken token)
Returns all the MWE entries in the index that contain the given token or
one of its stems as a part.
|
getMWEIndex
public Consecutive(IMWEIndex index)
index
- the index to be used when searching for MWEs. May not be
null
.public <T extends IToken> java.util.List<IMWE<T>> detect(java.util.List<T> sent)
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 sentencesent
- 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 <T extends IToken> boolean fillNextSlot(MWEBuilder<T> builder, T t)
T
- the type of the token being usedbuilder
- the builder to be filledt
- the token to fill the builder's next open slot withprotected java.util.Set<? extends IMWEDesc> getMWEDescs(IToken token)
token
- the token to be looked up in the indexCopyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.