gate.jape
Class Transducer

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

public abstract class Transducer
extends Object
implements Serializable, Benchmarkable

Represents a single or multiphase transducer.

See Also:
Serialized Form

Field Summary
protected  ActionContext actionContext
           
protected  Map benchmarkFeatures
          Shared featureMap
protected  String benchmarkID
          Benchmark ID of this transducer.
protected  boolean enableDebugging
          Switch used to activate the JAPE debugger
protected  boolean interrupted
           
protected  String name
          Name of this transducer.
protected  Ontology ontology
           
 
Constructor Summary
Transducer()
           
 
Method Summary
 void addProgressListener(ProgressListener l)
           
 void addStatusListener(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(String e)
           
 URL getBaseURL()
           
 String getBenchmarkId()
          Gets the benchmark ID of this transducer.
 String getName()
          Get the phase name of this transducer
 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 isEnableDebugging()
           
 boolean isInterrupted()
          Checks whether this PR has been interrupted since the last time its transduce(Document, AnnotationSet, AnnotationSet) method was called.
 boolean isMatchGroupMode()
           
 boolean isNegationCompatMode()
           
 void removeProgressListener(ProgressListener l)
           
 void removeStatusListener(StatusListener l)
           
 void setActionContext(ActionContext ac)
           
 void setBaseURL(URL newBaseURL)
           
 void setBenchmarkId(String benchmarkId)
          Set the benchmark ID for this transducer.
 void setDebugMode(boolean debugMode)
           
 void setEnableDebugging(boolean enableDebugging)
           
 void setMatchGroupMode(boolean mode)
           
 void setNegationCompatMode(boolean negationCompatMode)
           
 void setOntology(Ontology ontology)
          Sets the ontology used by this transducer;
abstract  String toString(String pad)
          Create a string representation of the object with padding.
abstract  void transduce(Document doc, AnnotationSet inputAS, 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 String name
Name of this transducer.


ontology

protected Ontology ontology

benchmarkFeatures

protected Map benchmarkFeatures
Shared featureMap


benchmarkID

protected String benchmarkID
Benchmark ID of this transducer.


interrupted

protected boolean interrupted

enableDebugging

protected boolean enableDebugging
Switch used to activate the JAPE debugger


actionContext

protected ActionContext actionContext
Constructor Detail

Transducer

public Transducer()
Method Detail

getName

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


getBenchmarkId

public String getBenchmarkId()
Gets the benchmark ID of this transducer.

Specified by:
getBenchmarkId in interface Benchmarkable

setBenchmarkId

public void setBenchmarkId(String benchmarkId)
Set the benchmark ID for this transducer.

Specified by:
setBenchmarkId in interface Benchmarkable
Parameters:
benchmarkId - the benchmark ID, which must not contain spaces as it is already used as a separator in the log, you can use Benchmark.createBenchmarkId(String, String) for it.

transduce

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

Throws:
JapeException
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 String toString(String pad)
Create a string representation of the object with padding.


isInterrupted

public boolean isInterrupted()
Checks whether this PR has been interrupted since the last time its transduce(Document, AnnotationSet, AnnotationSet) method was called.


interrupt

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


setBaseURL

public void setBaseURL(URL newBaseURL)

getBaseURL

public URL getBaseURL()

removeProgressListener

public void removeProgressListener(ProgressListener l)

addProgressListener

public void addProgressListener(ProgressListener l)

setDebugMode

public void setDebugMode(boolean debugMode)

isDebugMode

public boolean isDebugMode()

setMatchGroupMode

public void setMatchGroupMode(boolean mode)

isMatchGroupMode

public boolean isMatchGroupMode()

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(StatusListener l)

addStatusListener

public void addStatusListener(StatusListener l)

fireStatusChanged

protected void fireStatusChanged(String e)

getOntology

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

Returns:
an Ontology value;

setOntology

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

Parameters:
ontology - an Ontology value;

isEnableDebugging

public boolean isEnableDebugging()

setEnableDebugging

public void setEnableDebugging(boolean enableDebugging)

isNegationCompatMode

public boolean isNegationCompatMode()

setNegationCompatMode

public void setNegationCompatMode(boolean negationCompatMode)

setActionContext

public void setActionContext(ActionContext ac)