edu.mit.jmwe.detect
Class LeskAtLeast

java.lang.Object
  extended by edu.mit.jmwe.detect.HasMWEDetector
      extended by edu.mit.jmwe.detect.FilterByScore
          extended by edu.mit.jmwe.detect.LeskAtLeast
All Implemented Interfaces:
IHasMWEDetector, IMWEDetector, IMWEDetectorFilter

public class LeskAtLeast
extends FilterByScore

A filter detector that throws out MWEs whose lesk score is less than some value.

Since:
jMWE 1.0.0
Version:
$Id: LeskAtLeast.java 610 2011-05-06 20:05:20Z markaf $
Author:
M.A. Finlayson

Field Summary
protected  edu.mit.jwi.IDictionary dict
           
protected  int minScore
           
 
Constructor Summary
LeskAtLeast(IMWEDetector detector, edu.mit.jwi.IDictionary dict, int minScore)
          Constructs a new filter that filters out MWEs whose lesk score is not at least some value.
 
Method Summary
protected
<T extends IToken>
IScorer<IMWE<T>>
getScorer(List<T> sentence)
          Returns a scoring function for the specified sentence.
protected  boolean isGoodScore(double score)
          Returns true if the score passes the filter (i.e., the scored MWE should be kept); false otherwise
 
Methods inherited from class edu.mit.jmwe.detect.FilterByScore
detect
 
Methods inherited from class edu.mit.jmwe.detect.HasMWEDetector
getWrappedDetector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.mit.jmwe.detect.IHasMWEDetector
getWrappedDetector
 

Field Detail

minScore

protected final int minScore

dict

protected final edu.mit.jwi.IDictionary dict
Constructor Detail

LeskAtLeast

public LeskAtLeast(IMWEDetector detector,
                   edu.mit.jwi.IDictionary dict,
                   int minScore)
Constructs a new filter that filters out MWEs whose lesk score is not at least some value.

Parameters:
detector - the wrapped detector, may not be null
Since:
jMWE 1.0.0
Method Detail

isGoodScore

protected boolean isGoodScore(double score)
Description copied from class: FilterByScore
Returns true if the score passes the filter (i.e., the scored MWE should be kept); false otherwise

Specified by:
isGoodScore in class FilterByScore
Parameters:
score - the score to be checked
Returns:
true if the score passes the filter (i.e., the scored MWE should be kept); false otherwise

getScorer

protected <T extends IToken> IScorer<IMWE<T>> getScorer(List<T> sentence)
Description copied from class: FilterByScore
Returns a scoring function for the specified sentence.

Specified by:
getScorer in class FilterByScore
Type Parameters:
T - the type of token in the sentence
Parameters:
sentence - the sentence for which the scorer should be constructed
Returns:
a scorer for MWEs in the specified sentence


Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.