edu.washington.cs.knowitall.nlp
Class ChunkedSentenceIterator

java.lang.Object
  extended by com.google.common.collect.UnmodifiableIterator<T>
      extended by com.google.common.collect.AbstractIterator<ChunkedSentence>
          extended by 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

Constructor Summary
ChunkedSentenceIterator(java.util.Iterator<java.lang.String> sentIter, SentenceChunker chunker)
           
 
Method Summary
 void addFilter(com.google.common.base.Predicate<ChunkedSentence> filter)
          If a chunked sentence is filtered, it will not be returned.
protected  ChunkedSentence computeNext()
           
 
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
 

Constructor Detail

ChunkedSentenceIterator

public ChunkedSentenceIterator(java.util.Iterator<java.lang.String> sentIter,
                               SentenceChunker chunker)
Parameters:
sentIter - an iterator over String sentences.
chunker -
Method Detail

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>