gate.creole
Class Transducer

java.lang.Object
  |
  +--gate.util.AbstractFeatureBearer
        |
        +--gate.creole.AbstractResource
              |
              +--gate.creole.AbstractProcessingResource
                    |
                    +--gate.creole.AbstractLanguageAnalyser
                          |
                          +--gate.creole.Transducer
All Implemented Interfaces:
Executable, FeatureBearer, LanguageAnalyser, NameBearer, ProcessingResource, Resource, Serializable
Direct Known Subclasses:
ANNIETransducer, VPChunker

public class Transducer
extends AbstractLanguageAnalyser

A cascaded multi-phase transducer using the Jape language which is a variant of the CPSL language.

See Also:
Serialized Form

Constructor Summary
Transducer()
          Default constructor.
 
Method Summary
 void execute()
          Implementation of the run() method from Runnable.
 String getEncoding()
          Gets the encoding used for reding the grammar file(s).
 URL getGrammarURL()
          Gets the URL to the grammar used to build this transducer.
 String getInputASName()
          Gets the AnnotationSet used as input by this transducer.
 String getOutputASName()
          Gets the AnnotationSet used as output by this transducer.
 Resource init()
          This method is the one responsible for initialising the transducer.
 void interrupt()
          Notifies all the PRs in this controller that they should stop their execution as soon as possible.
 void setEncoding(String newEncoding)
          Sets the encoding to be used for reding the input file(s) forming the Jape grammar.
 void setGrammarURL(URL newGrammarURL)
          Sets the grammar to be used for building this transducer.
 void setInputASName(String newInputASName)
          Sets the AnnotationSet to be used as input for the transducer.
 void setOutputASName(String newOutputASName)
          Sets the AnnotationSet to be used as output by the transducer.
 
Methods inherited from class gate.creole.AbstractLanguageAnalyser
getCorpus, getDocument, setCorpus, setDocument
 
Methods inherited from class gate.creole.AbstractProcessingResource
addProgressListener, addStatusListener, cleanup, isInterrupted, reInit, removeProgressListener, removeStatusListener
 
Methods inherited from class gate.creole.AbstractResource
checkParameterValues, getName, getParameterValue, getParameterValue, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners
 
Methods inherited from class gate.util.AbstractFeatureBearer
getFeatures, setFeatures
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gate.ProcessingResource
isInterrupted, reInit
 
Methods inherited from interface gate.Resource
cleanup, getParameterValue, setParameterValue, setParameterValues
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 

Constructor Detail

Transducer

public Transducer()
Default constructor. Does nothing apart from calling the default constructor from the super class. The actual object initialisation is done via the init() method.
Method Detail

init

public Resource init()
              throws ResourceInstantiationException
This method is the one responsible for initialising the transducer. It assumes that all the needed parameters have been already set using the appropiate setXXX() methods.
Overrides:
init in class AbstractProcessingResource
Returns:
a reference to this

execute

public void execute()
             throws ExecutionException
Implementation of the run() method from Runnable. This method is responsible for doing all the processing of the input document.
Overrides:
execute in class AbstractProcessingResource

interrupt

public void interrupt()
Notifies all the PRs in this controller that they should stop their execution as soon as possible.
Overrides:
interrupt in class AbstractProcessingResource

setGrammarURL

public void setGrammarURL(URL newGrammarURL)
Sets the grammar to be used for building this transducer.
Parameters:
newGrammarURL - an URL to a file containing a Jape grammar.

getGrammarURL

public URL getGrammarURL()
Gets the URL to the grammar used to build this transducer.
Returns:
a URL pointing to the grammar file.

setEncoding

public void setEncoding(String newEncoding)
Sets the encoding to be used for reding the input file(s) forming the Jape grammar. Note that if the input grammar is a multi-file one than the same encoding will be used for reding all the files. Multi file grammars with different encoding across the composing files are not supported!
Parameters:
newEncoding - a {link String} representing the encoding.

getEncoding

public String getEncoding()
Gets the encoding used for reding the grammar file(s).

setInputASName

public void setInputASName(String newInputASName)
Sets the AnnotationSet to be used as input for the transducer.
Parameters:
newInputAS - a AnnotationSet

getInputASName

public String getInputASName()
Gets the AnnotationSet used as input by this transducer.
Returns:
a AnnotationSet

setOutputASName

public void setOutputASName(String newOutputASName)
Sets the AnnotationSet to be used as output by the transducer.
Parameters:
newOutputAS - a AnnotationSet

getOutputASName

public String getOutputASName()
Gets the AnnotationSet used as output by this transducer.
Returns:
a AnnotationSet