public abstract class ResolveByScore extends HasMWEDetector implements IMWEDetectorResolver
Modifier and Type | Field and Description |
---|---|
protected boolean |
chooseLargest |
Constructor and Description |
---|
ResolveByScore(IMWEDetector detector,
boolean chooseLargest)
Constructs a new MWE detector constraint that wraps the specified MWE
Detector.
|
Modifier and Type | Method and Description |
---|---|
<T extends IToken> |
detect(java.util.List<T> sentence)
Given a list of tokens, the detector searches for the MWEs in the list.
|
protected abstract <T extends IToken> |
getScorer(java.util.List<T> sentence)
Returns the scoring function for this filter.
|
getWrappedDetector
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getWrappedDetector
public ResolveByScore(IMWEDetector detector, boolean chooseLargest)
detector
- the detector wrapped by this object, may not be
NullPointerException
chooseLargest
- true
if the largest score should be chosen;
false
if the smallest should be used.java.lang.NullPointerException
- if the specified detector 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
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
Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.