gate.jape
Class Rule

java.lang.Object
  extended by gate.jape.Transducer
      extended by gate.jape.Rule
All Implemented Interfaces:
JapeConstants, Benchmarkable, Serializable

public class Rule
extends Transducer
implements JapeConstants, Serializable

A CPSL rule. Has an LHS, RHS and a name, and a priority.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class gate.jape.Transducer
actionContext, benchmarkFeatures, benchmarkID, enableDebugging, interrupted, name, ontology
 
Fields inherited from interface gate.jape.JapeConstants
ALL_STYLE, APPELT_STYLE, BRILL_STYLE, DEFAULT_PRIORITY, FIRST_STYLE, INDENT_PADDING, KLEENE_PLUS, KLEENE_QUERY, KLEENE_STAR, MULTI_SPAN_BINDING, NO_BINDING, NO_KLEENE_OP, ONCE_STYLE, SINGLE_SPAN_BINDING
 
Constructor Summary
Rule(String name, int position, int priority, LeftHandSide lhs, RightHandSide rhs)
          Construction
 
Method Summary
 void addProcessProgressListener(ProgressListener listener)
           
 void addStatusListener(StatusListener listener)
           
 void cleanUp()
          Clean up (delete action class files, for e.g.).
 void finish()
          Finish: replace dynamic data structures with Java arrays; called after parsing.
 boolean finished()
          Have we hit the end of the document without matching?
 LeftHandSide getLHS()
           
 int getPosition()
          Get the rule's position in sequence (e.g. order in file).
 int getPriority()
          Get the rule priority.
 RightHandSide getRHS()
           
 int pending()
          If we're pending (have matched), get the position we want to fire in, else -1.
 void removeProcessProgressListener(ProgressListener listener)
           
 void removeStatusListener(StatusListener listener)
           
 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 inputAS, AnnotationSet outputAS)
          Apply the RHS of this rule (LHS must have been matched first).
 
Methods inherited from class gate.jape.Transducer
addProgressListener, fireProcessFinished, fireProgressChanged, fireStatusChanged, getBaseURL, getBenchmarkId, getName, getOntology, interrupt, isDebugMode, isEnableDebugging, isInterrupted, isMatchGroupMode, isNegationCompatMode, removeProgressListener, setActionContext, setBaseURL, setBenchmarkId, setDebugMode, setEnableDebugging, setMatchGroupMode, setNegationCompatMode, setOntology
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rule

public Rule(String name,
            int position,
            int priority,
            LeftHandSide lhs,
            RightHandSide rhs)
Construction

Method Detail

getPriority

public int getPriority()
Get the rule priority.


getPosition

public int getPosition()
Get the rule's position in sequence (e.g. order in file).


pending

public int pending()
If we're pending (have matched), get the position we want to fire in, else -1.


finished

public boolean finished()
Have we hit the end of the document without matching?


finish

public void finish()
Finish: replace dynamic data structures with Java arrays; called after parsing. WARNING: bad choice of names: this is not related to the weFinished member or the finished method!

Specified by:
finish in class Transducer

transduce

public void transduce(Document doc,
                      AnnotationSet inputAS,
                      AnnotationSet outputAS)
               throws JapeException
Apply the RHS of this rule (LHS must have been matched first).

Specified by:
transduce in class Transducer
Throws:
JapeException

cleanUp

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

Specified by:
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.

Specified by:
toString in class Transducer

getLHS

public LeftHandSide getLHS()

getRHS

public RightHandSide getRHS()

addStatusListener

public void addStatusListener(StatusListener listener)
Overrides:
addStatusListener in class Transducer

removeStatusListener

public void removeStatusListener(StatusListener listener)
Overrides:
removeStatusListener in class Transducer

addProcessProgressListener

public void addProcessProgressListener(ProgressListener listener)

removeProcessProgressListener

public void removeProcessProgressListener(ProgressListener listener)