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:
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 ChunkedSentence objects.

Author:
afader

Constructor Summary
ChunkedSentenceIterator(Iterator<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()
           
 long getLastComputeTime()
           
 
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(Iterator<String> sentIter,
                               SentenceChunker chunker)
Parameters:
sentIter - an iterator over String sentences.
chunker -
Method Detail

getLastComputeTime

public long getLastComputeTime()
Returns:
the time of the last computation in nanoseconds

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>


Copyright © 2010-2012 University of Washington CSE. All Rights Reserved.