gate.creole
Class ConditionalSerialAnalyserController

java.lang.Object
  extended by gate.util.AbstractFeatureBearer
      extended by gate.creole.AbstractResource
          extended by gate.creole.AbstractController
              extended by gate.creole.SerialController
                  extended by gate.creole.ConditionalSerialController
                      extended by gate.creole.ConditionalSerialAnalyserController
All Implemented Interfaces:
Controller, CorpusController, ConditionalController, CustomDuplication, CreoleListener, Executable, LanguageAnalyser, ProcessingResource, Resource, Benchmarkable, FeatureBearer, NameBearer, Serializable, EventListener

@CreoleResource(name="Conditional Corpus Pipeline",
                comment="A serial controller for conditionally run PR pipelines over corpora.",
                helpURL="http://gate.ac.uk/userguide/sec:developer:cond")
public class ConditionalSerialAnalyserController
extends ConditionalSerialController
implements CorpusController, LanguageAnalyser

This class implements a SerialController that only contains LanguageAnalysers. It has a Corpus and its execute method runs all the analysers in turn over each of the documents in the corpus. This is a copy of the SerialAnalyserController, the only difference being that it inherits from ConditionalSerialController rather than from SerialController which makes it a conditional serial analyser controller.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class gate.creole.AbstractController
AbstractController.InternalStatusListener, AbstractController.IntervalProgressListener
 
Field Summary
protected  Corpus corpus
           
protected  Document document
          The document being processed.
 
Fields inherited from class gate.creole.ConditionalSerialController
strategiesList
 
Fields inherited from class gate.creole.SerialController
log, prList, prof, prTimeMap, sListener, timeMap
 
Fields inherited from class gate.creole.AbstractController
benchmarkFeatures, benchmarkID, interrupted
 
Fields inherited from class gate.creole.AbstractResource
name
 
Fields inherited from class gate.util.AbstractFeatureBearer
features
 
Constructor Summary
ConditionalSerialAnalyserController()
           
 
Method Summary
 void add(int index, ProcessingResource pr)
          Overidden from SerialController to only allow LanguageAnalysers as components.
 void add(ProcessingResource pr)
          Overidden from SerialController to only allow LanguageAnalysers as components.
protected  void checkLanguageAnalyser(ProcessingResource pr)
          Throw an exception if the given processing resource is not a LanguageAnalyser.
protected  void executeImpl()
          Run the Processing Resources in sequence.
 Corpus getCorpus()
          Returns the Corpus used by this controller.
 Document getDocument()
          Get the document property for this analyser.
 List getOffendingPocessingResources()
          Checks whether all the contained PRs have all the required runtime parameters set.
 void resourceUnloaded(CreoleEvent e)
          Overridden to also clean up the corpus value.
 void setCorpus(Corpus corpus)
          Sets the Corpus which contains the data on which the controller is going to run.
protected  void setDocToPrs(Document doc)
          Sets the current document to the memeber PRs
 void setDocument(Document document)
          Set the document property for this analyser.
 
Methods inherited from class gate.creole.ConditionalSerialController
cleanup, duplicate, getRunningStrategies, remove, remove, runComponent, setRunningStrategies, setRunningStrategy
 
Methods inherited from class gate.creole.SerialController
checkParameters, datastoreClosed, datastoreCreated, datastoreOpened, getPRs, getPrTimeMap, resetPrTimeMap, resourceLoaded, resourceRenamed, set, setPRs
 
Methods inherited from class gate.creole.AbstractController
addControllerListener, addProgressListener, addStatusListener, execute, fireProcessFinished, fireProgressChanged, fireResourceAdded, fireResourceRemoved, fireStatusChanged, getBenchmarkId, getControllerAwarePRs, init, interrupt, isInterrupted, reInit, removeControllerListener, removeProgressListener, removeStatusListener, setBenchmarkId
 
Methods inherited from class gate.creole.AbstractResource
checkParameterValues, getBeanInfo, getInitParameterValues, getInitParameterValues, getName, getParameterValue, getParameterValue, getParameterValues, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners
 
Methods inherited from class gate.util.AbstractFeatureBearer
getFeatures, setFeatures
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gate.Controller
execute, getPRs, setPRs
 
Methods inherited from interface gate.ProcessingResource
reInit
 
Methods inherited from interface gate.Resource
cleanup, getParameterValue, init, setParameterValue, setParameterValues
 
Methods inherited from interface gate.Executable
interrupt, isInterrupted
 

Field Detail

corpus

protected Corpus corpus

document

protected Document document
The document being processed. This is part of the LanguageAnalyser interface, so this value is only used when the controller is used as a member of another controller.

Constructor Detail

ConditionalSerialAnalyserController

public ConditionalSerialAnalyserController()
Method Detail

getDocument

public Document getDocument()
Description copied from interface: LanguageAnalyser
Get the document property for this analyser.

Specified by:
getDocument in interface LanguageAnalyser
Returns:
the document

setDocument

@Optional
@RunTime
@CreoleParameter
public void setDocument(Document document)
Description copied from interface: LanguageAnalyser
Set the document property for this analyser.

Specified by:
setDocument in interface LanguageAnalyser
Parameters:
document - the document to set

getCorpus

public Corpus getCorpus()
Description copied from interface: CorpusController
Returns the Corpus used by this controller.

Specified by:
getCorpus in interface CorpusController
Specified by:
getCorpus in interface LanguageAnalyser

setCorpus

public void setCorpus(Corpus corpus)
Description copied from interface: CorpusController
Sets the Corpus which contains the data on which the controller is going to run.

Specified by:
setCorpus in interface CorpusController
Specified by:
setCorpus in interface LanguageAnalyser

executeImpl

protected void executeImpl()
                    throws ExecutionException
Run the Processing Resources in sequence.

Overrides:
executeImpl in class SerialController
Throws:
ExecutionException

add

public void add(ProcessingResource pr)
Overidden from SerialController to only allow LanguageAnalysers as components.

Overrides:
add in class ConditionalSerialController
Parameters:
pr - the PR to be added.

add

public void add(int index,
                ProcessingResource pr)
Overidden from SerialController to only allow LanguageAnalysers as components.

Overrides:
add in class ConditionalSerialController
Parameters:
index - the position for the PR
pr - the PR to be set.

checkLanguageAnalyser

protected void checkLanguageAnalyser(ProcessingResource pr)
Throw an exception if the given processing resource is not a LanguageAnalyser.


setDocToPrs

protected void setDocToPrs(Document doc)
Sets the current document to the memeber PRs


getOffendingPocessingResources

public List getOffendingPocessingResources()
                                    throws ResourceInstantiationException
Checks whether all the contained PRs have all the required runtime parameters set. Ignores the corpus and document parameters as these will be set at run time.

Overrides:
getOffendingPocessingResources in class AbstractController
Returns:
a List of ProcessingResources that have required parameters with null values if they exist null otherwise.
Throws:
{@link - ResourceInstantiationException} if problems occur while inspecting the parameters for one of the resources. These will normally be introspection problems and are usually caused by the lack of a parameter or of the read accessor for a parameter.
ResourceInstantiationException

resourceUnloaded

public void resourceUnloaded(CreoleEvent e)
Overridden to also clean up the corpus value.

Specified by:
resourceUnloaded in interface CreoleListener
Overrides:
resourceUnloaded in class SerialController