edu.stanford.nlp.trees
Class FilteringTreeReader

java.lang.Object
  extended by edu.stanford.nlp.trees.FilteringTreeReader
All Implemented Interfaces:
TreeReader

public class FilteringTreeReader
extends Object
implements TreeReader

A FilteringTreeReader filters the output of another TreeReader. It applies a Filter<Tree> to each returned tree and only returns trees that are accepted by the Filter. The Filter should accept trees that it wants returned.

Author:
Christopher Manning

Constructor Summary
FilteringTreeReader(TreeReader tr, Filter<Tree> f)
           
 
Method Summary
 void close()
          Close the Reader behind this TreeReader.
 Tree readTree()
          Reads a single tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilteringTreeReader

public FilteringTreeReader(TreeReader tr,
                           Filter<Tree> f)
Method Detail

readTree

public Tree readTree()
              throws IOException
Reads a single tree.

Specified by:
readTree in interface TreeReader
Returns:
A single tree, or null at end of file.
Throws:
IOException

close

public void close()
           throws IOException
Close the Reader behind this TreeReader.

Specified by:
close in interface TreeReader
Throws:
IOException


Stanford NLP Group