edu.mit.jmwe.detect
Class MoreFrequentAsMWE

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

public class MoreFrequentAsMWE
extends FilterByScore

Filters the results of its backing detector to include only those MWEs whose parts, in a continuous run of tokens, are more often marked as an MWE than as individual tokens.

Since:
jMWE 1.0.0
Version:
$Id: MoreFrequentAsMWE.java 595 2011-05-06 01:58:29Z markaf $
Author:
M.A. Finlayson

Constructor Summary
MoreFrequentAsMWE(IMWEDetector detector)
          Constructs the detector from the given backing detector.
 
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
 

Constructor Detail

MoreFrequentAsMWE

public MoreFrequentAsMWE(IMWEDetector detector)
Constructs the detector from the given backing detector.

Parameters:
detector - the IMWEDetector that will be used to back this detector. May not be null.
Throws:
NullPointerException - if the backing detector is 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.