edu.washington.cs.knowitall.extractor.mapper
Class SentenceLengthFilter

java.lang.Object
  extended by edu.washington.cs.knowitall.extractor.mapper.Mapper<T>
      extended by edu.washington.cs.knowitall.extractor.mapper.FilterMapper<java.lang.String>
          extended by edu.washington.cs.knowitall.extractor.mapper.SentenceLengthFilter

public class SentenceLengthFilter
extends FilterMapper<java.lang.String>

A mapper used to filter sentences by number of words.

Author:
afader

Constructor Summary
SentenceLengthFilter(int minWords, int maxWords)
          Constructs a new SentenceLengthFilter object.
 
Method Summary
 boolean doFilter(java.lang.String sent)
           
static SentenceLengthFilter maxFilter(int maxWords)
          Constructs a new SentenceLengthFilter object, with no minimum length.
static SentenceLengthFilter minFilter(int minWords)
          Constructs a new SentenceLengthFilter object, with no maximum length.
 
Methods inherited from class edu.washington.cs.knowitall.extractor.mapper.FilterMapper
doMap
 
Methods inherited from class edu.washington.cs.knowitall.extractor.mapper.Mapper
disable, enable, isEnabled, map
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SentenceLengthFilter

public SentenceLengthFilter(int minWords,
                            int maxWords)
Constructs a new SentenceLengthFilter object.

Parameters:
minWords - the minimum number of words in the sentence.
maxWords - the maximum number of words in the sentence.
Method Detail

minFilter

public static SentenceLengthFilter minFilter(int minWords)
Constructs a new SentenceLengthFilter object, with no maximum length.

Parameters:
minWords - the minimum number of words.
Returns:
a new SentenceLengthFilter.

maxFilter

public static SentenceLengthFilter maxFilter(int maxWords)
Constructs a new SentenceLengthFilter object, with no minimum length.

Parameters:
maxWords - the maximum number of words.
Returns:
a new SentenceLengthFilter.

doFilter

public boolean doFilter(java.lang.String sent)
Specified by:
doFilter in class FilterMapper<java.lang.String>