edu.upenn.cis.spinal
Class EchoWalker

java.lang.Object
  extended by edu.upenn.cis.spinal.AbstractWalker
      extended by edu.upenn.cis.spinal.EchoWalker

public class EchoWalker
extends AbstractWalker

Walks through a treebank, reads it in, and prints it to stdout unchanged. This class is provided as a simple example of an implementation of AbstractWalker. It can be used for debugging purposes when testing the toString() methods. This class can also print to file if that file is given as a second argument.

Author:
Lucas Champollion

Field Summary
 
Fields inherited from class edu.upenn.cis.spinal.AbstractWalker
args, terminate
 
Constructor Summary
EchoWalker()
          Creates a new instance of EchoWalker.
 
Method Summary
 void forEachSentence(Sentence s)
          Implementations of this method should specify what the class should do on reading in a sentence (a derivation tree) from the file.
protected  void init()
          Implementations of this method should specify what (if anything) the class should do before attempting to read in a file.
static void main(String[] argv)
          Main method, call from command line.
protected  void printUsage()
          Implementations of this method should print out a short string to stdout describing the function of the class.
protected  void wrapUp()
          Implementations of this method should specify what (if anything) the class should do upon reading all sentences from the file.
 
Methods inherited from class edu.upenn.cis.spinal.AbstractWalker
getArgs, process, terminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EchoWalker

public EchoWalker()
Creates a new instance of EchoWalker.

Method Detail

init

protected void init()
Description copied from class: AbstractWalker
Implementations of this method should specify what (if anything) the class should do before attempting to read in a file.

Specified by:
init in class AbstractWalker

forEachSentence

public void forEachSentence(Sentence s)
Description copied from class: AbstractWalker
Implementations of this method should specify what the class should do on reading in a sentence (a derivation tree) from the file.

Specified by:
forEachSentence in class AbstractWalker
Parameters:
s - the current Sentence object

wrapUp

protected void wrapUp()
Description copied from class: AbstractWalker
Implementations of this method should specify what (if anything) the class should do upon reading all sentences from the file. The AbstractWalker.process(String[]) method also calls this if AbstractWalker.terminate() has been invoked.

Specified by:
wrapUp in class AbstractWalker

printUsage

protected void printUsage()
Description copied from class: AbstractWalker
Implementations of this method should print out a short string to stdout describing the function of the class. This method is automatically called by AbstractWalker.process(String[]) when no command-line argument is passed.

Specified by:
printUsage in class AbstractWalker

main

public static void main(String[] argv)
Main method, call from command line.

Parameters:
argv - the command line arguments