edu.stanford.nlp.parser.lexparser
Class AbstractTreeExtractor<T>

java.lang.Object
  extended by edu.stanford.nlp.parser.lexparser.AbstractTreeExtractor<T>
All Implemented Interfaces:
Extractor<T>
Direct Known Subclasses:
MLEDependencyGrammarExtractor

public abstract class AbstractTreeExtractor<T>
extends Object
implements Extractor<T>

An abstract superclass for parser classes that extract counts from Trees.

Author:
grenager, Sarah Spikes (sdspikes@cs.stanford.edu) - cleanup and filling in types

Field Summary
protected  Options op
           
 
Constructor Summary
protected AbstractTreeExtractor(Options op)
           
 
Method Summary
 T extract()
           
 T extract(Collection<Tree> treeList)
           
 T extract(Collection<Tree> trees1, double weight1, Collection<Tree> trees2, double weight2)
           
 T extract(Iterator<Tree> iterator, Function<Tree,Tree> f)
           
 T extract(Iterator<Tree> treeIterator, Function<Tree,Tree> f, double weight)
           
 T formResult()
           
protected  void tallyInternalNode(Tree lt, double weight)
           
protected  void tallyLeaf(Tree lt, double weight)
           
protected  void tallyLocalTree(Tree lt, double weight)
           
protected  void tallyPreTerminal(Tree lt, double weight)
           
protected  void tallyRoot(Tree lt, double weight)
           
 void tallyTree(Tree t, double weight)
           
protected  void tallyTreeIterator(Iterator<Tree> treeIterator, Function<Tree,Tree> f, double weight)
           
protected  void tallyTrees(Collection<Tree> trees, double weight)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

op

protected final Options op
Constructor Detail

AbstractTreeExtractor

protected AbstractTreeExtractor(Options op)
Method Detail

tallyLeaf

protected void tallyLeaf(Tree lt,
                         double weight)

tallyPreTerminal

protected void tallyPreTerminal(Tree lt,
                                double weight)

tallyInternalNode

protected void tallyInternalNode(Tree lt,
                                 double weight)

tallyRoot

protected void tallyRoot(Tree lt,
                         double weight)

formResult

public T formResult()

tallyLocalTree

protected void tallyLocalTree(Tree lt,
                              double weight)

tallyTree

public void tallyTree(Tree t,
                      double weight)

tallyTrees

protected void tallyTrees(Collection<Tree> trees,
                          double weight)

tallyTreeIterator

protected void tallyTreeIterator(Iterator<Tree> treeIterator,
                                 Function<Tree,Tree> f,
                                 double weight)

extract

public T extract()

extract

public T extract(Collection<Tree> treeList)
Specified by:
extract in interface Extractor<T>

extract

public T extract(Collection<Tree> trees1,
                 double weight1,
                 Collection<Tree> trees2,
                 double weight2)

extract

public T extract(Iterator<Tree> treeIterator,
                 Function<Tree,Tree> f,
                 double weight)

extract

public T extract(Iterator<Tree> iterator,
                 Function<Tree,Tree> f)
Specified by:
extract in interface Extractor<T>


Stanford NLP Group