gate.yam.translate
Class PrettyTranslator

java.lang.Object
  extended by gate.yam.translate.AbstractTranslator
      extended by gate.yam.translate.PrettyTranslator
All Implemented Interfaces:
TranslationConstants

public class PrettyTranslator
extends AbstractTranslator

This class is a pretty-printer for YAM documents. It takes a parse tree as input, munges the whitespace in the Token images, and prints it to the supplied writer.

Author:
Hamish Cunningham

Field Summary
static boolean pleaseLeakLotsOfMemory
          For debugging, set this true and the GATE docs that the translator creates will not be deleted.
 
Fields inherited from class gate.yam.translate.AbstractTranslator
translatorType
 
Fields inherited from interface gate.yam.translate.TranslationConstants
CONSTANTEND, CONSTANTNAME, CONSTANTSTART
 
Constructor Summary
PrettyTranslator()
          Construction.
 
Method Summary
 String[][] getConstantsTable()
          Array mapping node type name to start/end strings.
 String getPreamblePath()
          Get the path to the preamble resource.
 Object[][] getPredicatesTable()
          Array mapping predicate type name to attributes.
 void processURLs(SimpleNode node)
          Process URLs and Anchors.
 Writer translate()
          Translation.
 
Methods inherited from class gate.yam.translate.AbstractTranslator
addToFooter, getConstantEnd, getConstantStart, makeContents, makePreamble, printEndNotes, printTree, printTree, printTree, setIOHandler, setParseTree, setWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pleaseLeakLotsOfMemory

public static boolean pleaseLeakLotsOfMemory
For debugging, set this true and the GATE docs that the translator creates will not be deleted. A fun trick to play on your colleagues is to set this true and then deploy into your favourite web container and sit back and wait for the screams from the systems admin team.

Constructor Detail

PrettyTranslator

public PrettyTranslator()
Construction.

Method Detail

getPreamblePath

public String getPreamblePath()
Get the path to the preamble resource. Unused.


getConstantsTable

public String[][] getConstantsTable()
Array mapping node type name to start/end strings. Unused.


getPredicatesTable

public Object[][] getPredicatesTable()
Array mapping predicate type name to attributes. Unused.


translate

public Writer translate()
                 throws gate.util.GateException
Translation. Results are written to the Writer, which is also returned.

Overrides:
translate in class AbstractTranslator
Throws:
gate.util.GateException

processURLs

public void processURLs(SimpleNode node)
                 throws gate.util.GateException
Process URLs and Anchors.

Specified by:
processURLs in class AbstractTranslator
Throws:
gate.util.GateException