gate.jape
Class MultiPhaseTransducer

java.lang.Object
  |
  +--gate.jape.Transducer
        |
        +--gate.jape.MultiPhaseTransducer
All Implemented Interfaces:
JapeConstants, Serializable

public class MultiPhaseTransducer
extends Transducer
implements JapeConstants, Serializable

Represents a complete CPSL grammar, with a phase name, options and rule set (accessible by name and by sequence). Implements a transduce method taking a Document as input. Constructs from String or File.

See Also:
Serialized Form

Field Summary
private static boolean DEBUG
          Debug flag
private  ArrayList phases
          The SinglePhaseTransducers that make up this one.
 
Fields inherited from class gate.jape.Transducer
baseURL, debugMode, interrupted, name, progressListeners, statusListeners
 
Fields inherited from interface gate.jape.JapeConstants
APPELT_STYLE, BRILL_STYLE, DEFAULT_PRIORITY, FIRST_STYLE, INDENT_PADDING, KLEENE_PLUS, KLEENE_QUERY, KLEENE_STAR, MULTI_SPAN_BINDING, NO_BINDING, NO_KLEENE_OP, SINGLE_SPAN_BINDING
 
Constructor Summary
MultiPhaseTransducer()
          Anonymous construction
MultiPhaseTransducer(String name)
          Construction from name.
 
Method Summary
 void addPhase(String name, Transducer phase)
          Add phase.
 void cleanUp()
          Ask each phase to clean up (delete action class files, for e.g.).
 void finish()
          Finish: replace dynamic data structures with Java arrays; called after parsing.
 ArrayList getPhases()
           
 void interrupt()
          Notifies this PR that it should stop its execution as soon as possible.
 void orderPhases(String[] phaseNames)
          Change the phase order to the one specified in a list of names.
 void setName(String name)
          Set the name.
 String toString()
          Create a string representation of the object.
 String toString(String pad)
          Create a string representation of the object.
 void transduce(Document doc, AnnotationSet input, AnnotationSet output)
          Transduce the document by running each phase in turn.
 
Methods inherited from class gate.jape.Transducer
addProgressListener, addStatusListener, fireProcessFinished, fireProgressChanged, fireStatusChanged, getBaseURL, getName, isDebugMode, isInterrupted, removeProgressListener, removeStatusListener, setBaseURL, setDebugMode
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
Debug flag

phases

private ArrayList phases
The SinglePhaseTransducers that make up this one. Keyed by their phase names.
Constructor Detail

MultiPhaseTransducer

public MultiPhaseTransducer(String name)
Construction from name.

MultiPhaseTransducer

public MultiPhaseTransducer()
Anonymous construction
Method Detail

interrupt

public void interrupt()
Notifies this PR that it should stop its execution as soon as possible.
Overrides:
interrupt in class Transducer

setName

public void setName(String name)
Set the name.

addPhase

public void addPhase(String name,
                     Transducer phase)
Add phase.

orderPhases

public void orderPhases(String[] phaseNames)
Change the phase order to the one specified in a list of names.

finish

public void finish()
Finish: replace dynamic data structures with Java arrays; called after parsing.
Overrides:
finish in class Transducer

transduce

public void transduce(Document doc,
                      AnnotationSet input,
                      AnnotationSet output)
               throws JapeException,
                      ExecutionException
Transduce the document by running each phase in turn.
Overrides:
transduce in class Transducer

cleanUp

public void cleanUp()
Ask each phase to clean up (delete action class files, for e.g.).
Overrides:
cleanUp in class Transducer

toString

public String toString()
Create a string representation of the object.
Overrides:
toString in class Object

toString

public String toString(String pad)
Create a string representation of the object.
Overrides:
toString in class Transducer

getPhases

public ArrayList getPhases()