edu.upenn.cis.spinal
Class GraphvizWalker

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

public class GraphvizWalker
extends AbstractWalker

Walks through a treebank, reads it in, and outputs representations of the trees in Graphviz format. Alternatively, selects a given sentence (identified by its location) in the treebank and outputs a Graphviz representation for that sentence.

 Usage: java edu.upenn.cis.spinal.GraphvizWalker <infile> [<sentence_location>] 
 Output will be placed in files named <sentence_location>.dot.
 If <sentence_location> is not given, then all the sentences in the file will be processed and placed into a separate file each.
 

Author:
Lucas Champollion

Field Summary
 
Fields inherited from class edu.upenn.cis.spinal.AbstractWalker
args, terminate
 
Constructor Summary
GraphvizWalker()
          Creates a new instance of GraphvizWalker.
 
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()
          Prints out the following message:
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

GraphvizWalker

public GraphvizWalker()
Creates a new instance of GraphvizWalker.

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()
Prints out the following message:
 Usage: java edu.upenn.cis.spinal.GraphvizWalker <infile> [<sentence_location>] 
 Output will be placed in files named <sentence_location>.dot.
 If <sentence_location> is not given, then all the sentences in the file will be processed and placed into a separate file each.
 

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