edu.washington.cs.knowitall.nlp
Class ChunkedSentenceIterator
java.lang.Object
com.google.common.collect.UnmodifiableIterator<T>
com.google.common.collect.AbstractIterator<ChunkedSentence>
edu.washington.cs.knowitall.nlp.ChunkedSentenceIterator
- All Implemented Interfaces:
- java.util.Iterator<ChunkedSentence>
public class ChunkedSentenceIterator
- extends com.google.common.collect.AbstractIterator<ChunkedSentence>
A class that combines an Iterator
object over sentences with a
SentenceChunker
object to produce an iterator over NpChunkedSentence
objects.
- Author:
- afader
Methods inherited from class com.google.common.collect.AbstractIterator |
endOfData, hasNext, next, peek |
Methods inherited from class com.google.common.collect.UnmodifiableIterator |
remove |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ChunkedSentenceIterator
public ChunkedSentenceIterator(java.util.Iterator<java.lang.String> sentIter,
SentenceChunker chunker)
- Parameters:
sentIter
- an iterator over String
sentences.chunker
-
addFilter
public void addFilter(com.google.common.base.Predicate<ChunkedSentence> filter)
- If a chunked sentence is filtered, it will not be returned.
- Parameters:
filter
- A predicate to test chunked sentences against.
computeNext
protected ChunkedSentence computeNext()
- Specified by:
computeNext
in class com.google.common.collect.AbstractIterator<ChunkedSentence>