edu.washington.cs.knowitall.extractor.mapper
Class SentenceLengthFilter
java.lang.Object
edu.washington.cs.knowitall.extractor.mapper.Mapper<T>
edu.washington.cs.knowitall.extractor.mapper.FilterMapper<java.lang.String>
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. |
Methods inherited from class edu.washington.cs.knowitall.extractor.mapper.FilterMapper |
doMap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
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>