TreeVisitor.java :  » Natural-Language-Processing » Stanford-Parser » edu » stanford » nlp » trees » Java Open Source

Java Open Source » Natural Language Processing » Stanford Parser 
Stanford Parser » edu » stanford » nlp » trees » TreeVisitor.java
package edu.stanford.nlp.trees;

/**
 * This is a simple strategy-type interface for operations that are applied to
 * <code>Tree</code>. It typically is called iteratively over
 * trees in a <code>Treebank</code>.  The convention is for <code>TreeVisitor</code> implementing
 * classes not to affect <code>Tree</code> instances they operate on, but to accomplish things via
 * side effects (like counting statistics over trees, etc.).
 *
 * @author Christopher Manning
 * @author Roger Levy
 */
public interface TreeVisitor {

  /**
   * Does whatever one needs to do to a particular parse tree.
   *
   * @param t A tree.  Classes implementing this interface can assume
   *          that the tree passed in is not <code>null</code>.
   */
  public void visitTree(Tree t);

}

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.