gate.jape
Class SinglePhaseTransducer

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

public class SinglePhaseTransducer
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

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, ONCE_STYLE, SINGLE_SPAN_BINDING
 
Constructor Summary
SinglePhaseTransducer(String name)
          Construction from name.
 
Method Summary
 void addInput(String ident)
          Adds a new type of input annotations used by this transducer.
 void addProgressListener(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.
 FSM getFSM()
           
 String getOption(String name)
          Get the value for a particular option.
 int getRuleApplicationStyle()
           
 PrioritisedRuleList getRules()
           
 void removeProgressListener(ProgressListener l)
           
 void setOption(String name, String setting)
          Add an option setting.
 void setRuleApplicationStyle(int style)
          Set the type of rule application (types defined in JapeConstants).
 String toString()
          A string representation of this object.
 String toString(String pad)
          A string representation of this object.
 void transduce(Document doc, AnnotationSet inputAS, AnnotationSet outputAS)
          Transduce a document using the annotation set provided and the current rule application style.
 
Methods inherited from class gate.jape.Transducer
addStatusListener, getBaseURL, getName, getOntology, interrupt, isDebugMode, isInterrupted, removeStatusListener, setBaseURL, setDebugMode, setOntology
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SinglePhaseTransducer

public SinglePhaseTransducer(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(String name,
                      String setting)
Add an option setting. If this option is set already, the new value overwrites the previous one.

getOption

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

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 inputAS,
                      AnnotationSet outputAS)
               throws JapeException,
                      ExecutionException
Transduce a document using the annotation set provided and the current rule application style.
Overrides:
transduce in class Transducer

cleanUp

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

toString

public String toString()
A string representation of this object.
Overrides:
toString in class Object

toString

public String toString(String pad)
A string representation of this object.
Overrides:
toString in class Transducer

getRules

public PrioritisedRuleList getRules()

addInput

public void addInput(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(ProgressListener l)
Overrides:
removeProgressListener in class Transducer

addProgressListener

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

getRuleApplicationStyle

public int getRuleApplicationStyle()