at.ofai.gate.jape
Class Transducer

java.lang.Object
  extended by at.ofai.gate.jape.Transducer
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
MultiPhaseTransducer, Rule, SinglePhaseTransducer

public abstract class Transducer
extends java.lang.Object
implements java.io.Serializable

Represents a single or multiphase transducer.

See Also:
Serialized Form

Field Summary
protected  boolean interrupted
           
protected  java.lang.String name
          Name of this transducer.
protected  gate.creole.ontology.Ontology ontology
           
 
Constructor Summary
Transducer()
           
 
Method Summary
 void addProgressListener(gate.event.ProgressListener l)
           
 void addStatusListener(gate.event.StatusListener l)
           
abstract  void cleanUp()
          Clean up (delete action class files, for e.g.).
abstract  void finish()
          Finish: replace dynamic data structures with Java arrays; called after parsing.
protected  void fireProcessFinished()
           
protected  void fireProgressChanged(int e)
          This property affects the Appelt style of rules application.
protected  void fireStatusChanged(java.lang.String e)
           
 java.net.URL getBaseURL()
           
 java.lang.String getName()
          Get the phase name of this transducer
 gate.creole.ontology.Ontology getOntology()
          Gets the ontology used by this transducer;
 void interrupt()
          Notifies this PR that it should stop its execution as soon as possible.
 boolean isDebugMode()
           
 boolean isInterrupted()
          Checks whether this PR has been interrupted since the lsat time its execute method was called.
 void removeProgressListener(gate.event.ProgressListener l)
           
 void removeStatusListener(gate.event.StatusListener l)
           
 void setBaseURL(java.net.URL newBaseURL)
           
 void setDebugMode(boolean debugMode)
           
 void setOntology(gate.creole.ontology.Ontology ontology)
          Sets the ontology used by this transducer;
abstract  java.lang.String toString(java.lang.String pad)
          Create a string representation of the object with padding.
abstract  void transduce(gate.Document doc, gate.AnnotationSet inputAS, gate.AnnotationSet outputAS)
          Transduce a document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
Name of this transducer.


ontology

protected gate.creole.ontology.Ontology ontology

interrupted

protected boolean interrupted
Constructor Detail

Transducer

public Transducer()
Method Detail

getName

public java.lang.String getName()
Get the phase name of this transducer


transduce

public abstract void transduce(gate.Document doc,
                               gate.AnnotationSet inputAS,
                               gate.AnnotationSet outputAS)
                        throws JapeException,
                               gate.creole.ExecutionException
Transduce a document.

Throws:
JapeException
gate.creole.ExecutionException

finish

public abstract void finish()
Finish: replace dynamic data structures with Java arrays; called after parsing.


cleanUp

public abstract void cleanUp()
Clean up (delete action class files, for e.g.).


toString

public abstract java.lang.String toString(java.lang.String pad)
Create a string representation of the object with padding.


isInterrupted

public boolean isInterrupted()
Checks whether this PR has been interrupted since the lsat time its execute method was called.


interrupt

public void interrupt()
Notifies this PR that it should stop its execution as soon as possible.


setBaseURL

public void setBaseURL(java.net.URL newBaseURL)

getBaseURL

public java.net.URL getBaseURL()

removeProgressListener

public void removeProgressListener(gate.event.ProgressListener l)

addProgressListener

public void addProgressListener(gate.event.ProgressListener l)

setDebugMode

public void setDebugMode(boolean debugMode)

isDebugMode

public boolean isDebugMode()

fireProgressChanged

protected void fireProgressChanged(int e)
This property affects the Appelt style of rules application. If true then the longest match will be fired otherwise the shortest will be used. By default it is true.


fireProcessFinished

protected void fireProcessFinished()

removeStatusListener

public void removeStatusListener(gate.event.StatusListener l)

addStatusListener

public void addStatusListener(gate.event.StatusListener l)

fireStatusChanged

protected void fireStatusChanged(java.lang.String e)

getOntology

public gate.creole.ontology.Ontology getOntology()
Gets the ontology used by this transducer;

Returns:
an Ontology value;

setOntology

public void setOntology(gate.creole.ontology.Ontology ontology)
Sets the ontology used by this transducer;

Parameters:
ontology - an Ontology value;