at.ofai.gate.jape
Class SinglePhaseTransducer

java.lang.Object
  extended by at.ofai.gate.jape.Transducer
      extended by at.ofai.gate.jape.SinglePhaseTransducer
All Implemented Interfaces:
JapeConstants, java.io.Serializable

public class SinglePhaseTransducer
extends Transducer
implements JapeConstants, java.io.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
 
Fields inherited from class at.ofai.gate.jape.Transducer
interrupted, name, ontology
 
Fields inherited from interface at.ofai.gate.jape.JapeConstants
APPELT_STYLE, BRILL_STYLE, DEFAULT_PRIORITY, EQUAL, FIRST_STYLE, GREATER, GREATER_OR_EQUAL, INDENT_PADDING, KLEENE_PLUS, KLEENE_QUERY, KLEENE_STAR, LESSER, LESSER_OR_EQUAL, MULTI_SPAN_BINDING, NO_BINDING, NO_KLEENE_OP, NOT_EQUAL, NOT_REGEXP, ONCE_STYLE, REGEXP, SINGLE_SPAN_BINDING
 
Constructor Summary
SinglePhaseTransducer(java.lang.String name)
          Construction from name.
 
Method Summary
 void addInput(java.lang.String ident)
          Adds a new type of input annotations used by this transducer.
 void addProgressListener(gate.event.ProgressListener l)
           
 void addRule(Rule rule)
          Add a rule.
 void cleanUp()
          Clean up (delete action class files, for e.g.).
 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.
 FSM getFSM()
           
 java.lang.String getOption(java.lang.String name)
          Get the value for a particular option.
 int getRuleApplicationStyle()
           
 PrioritisedRuleList getRules()
           
 void removeProgressListener(gate.event.ProgressListener l)
           
 void setOption(java.lang.String name, java.lang.String setting)
          Add an option setting.
 void setRuleApplicationStyle(int style)
          Set the type of rule application (types defined in JapeConstants).
 java.lang.String toString()
          A string representation of this object.
 java.lang.String toString(java.lang.String pad)
          A string representation of this object.
 void transduce(gate.Document doc, gate.AnnotationSet inputAS, gate.AnnotationSet outputAS)
          Transduce a document using the annotation set provided and the current rule application style.
 
Methods inherited from class at.ofai.gate.jape.Transducer
addStatusListener, fireStatusChanged, getBaseURL, getName, getOntology, interrupt, isDebugMode, isInterrupted, removeStatusListener, setBaseURL, setDebugMode, setOntology
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SinglePhaseTransducer

public SinglePhaseTransducer(java.lang.String name)
Construction from name.

Method Detail

setRuleApplicationStyle

public void setRuleApplicationStyle(int style)
Set the type of rule application (types defined in JapeConstants).


getFSM

public FSM getFSM()

addRule

public void addRule(Rule rule)
Add a rule.


setOption

public void setOption(java.lang.String name,
                      java.lang.String setting)
Add an option setting. If this option is set already, the new value overwrites the previous one.


getOption

public java.lang.String getOption(java.lang.String name)
Get the value for a particular option.


finish

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

Specified by:
finish in class Transducer

transduce

public void transduce(gate.Document doc,
                      gate.AnnotationSet inputAS,
                      gate.AnnotationSet outputAS)
               throws JapeException,
                      gate.creole.ExecutionException
Transduce a document using the annotation set provided and the current rule application style.

Specified by:
transduce in class Transducer
Throws:
JapeException
gate.creole.ExecutionException

cleanUp

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

Specified by:
cleanUp in class Transducer

toString

public java.lang.String toString()
A string representation of this object.

Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.String pad)
A string representation of this object.

Specified by:
toString in class Transducer

getRules

public PrioritisedRuleList getRules()

addInput

public void addInput(java.lang.String ident)
Adds a new type of input annotations used by this transducer. If the list of input types is empty this transducer will parse all the annotations in the document otherwise the types not found in the input list will be completely ignored! To be used with caution!


removeProgressListener

public void removeProgressListener(gate.event.ProgressListener l)
Overrides:
removeProgressListener in class Transducer

addProgressListener

public void addProgressListener(gate.event.ProgressListener l)
Overrides:
addProgressListener in class Transducer

fireProgressChanged

protected void fireProgressChanged(int e)
Description copied from class: Transducer
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.

Overrides:
fireProgressChanged in class Transducer

fireProcessFinished

protected void fireProcessFinished()
Overrides:
fireProcessFinished in class Transducer

getRuleApplicationStyle

public int getRuleApplicationStyle()