org.writersforge.catalan.transform.xml
Class TextToLattice

java.lang.Object
  extended byorg.writersforge.catalan.transform.BaseNodeProcessor
      extended byorg.writersforge.catalan.transform.xml.TextToLattice
All Implemented Interfaces:
org.writersforge.bellows.traverse.NodeProcessor

public class TextToLattice
extends BaseNodeProcessor

A conversion processor which turns simple ASCII text documents into Lattice XML documents.

Author:
jsheets

Constructor Summary
TextToLattice(boolean convert)
          Creates a new instance of TextToLattice.
TextToLattice(org.writersforge.bellows.Datum xml)
          Creates a new instance of TextToLattice from the XML spec.
 
Method Summary
 java.util.List processNode(java.lang.Object node)
          Process a single node.
 
Methods inherited from class org.writersforge.catalan.transform.BaseNodeProcessor
addLeftover, end, getLeftovers, getNodes, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextToLattice

public TextToLattice(org.writersforge.bellows.Datum xml)
Creates a new instance of TextToLattice from the XML spec.

Parameters:
xml - XML initializing spec

TextToLattice

public TextToLattice(boolean convert)
Creates a new instance of TextToLattice.

Parameters:
convert - if true, convert the XML content to a Datum tree; if false, leave the XML content in String form
Method Detail

processNode

public java.util.List processNode(java.lang.Object node)
Process a single node. The processing action can be any arbitrary task, such as text replacement, data restructuring, or even statistical gathering. The processor should return a processed version of the node; this can be the same object untouched, or the same object modified, or a new set of objects.

Parameters:
node - the node to process
Returns:
a List of processing results (can be empty)