gate.jape
Interface ActionContext

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultActionContext

public interface ActionContext
extends Serializable

Interface describing an "action context" for a JAPE Java RHS. An action context provides access to the JAPE processing resource's feature map and the corpus the JAPE PR is running on.

Author:
Johann Petrak

Method Summary
 boolean endPhase()
          Request the current JAPE phase to be ended as soon as possible.
 Controller getController()
          Provide access to the controller running the PR this action context lives in.
 Corpus getCorpus()
          Provide access to the corpus a JAPE processing resource is running on.
 FeatureMap getPRFeatures()
          Provide access to the feature map associated with the JAPE processing resource.
 

Method Detail

getCorpus

Corpus getCorpus()
Provide access to the corpus a JAPE processing resource is running on.

Returns:
the corpus LR the JAPE transducer is processing, null if no such corpus exists.

getPRFeatures

FeatureMap getPRFeatures()
Provide access to the feature map associated with the JAPE processing resource.

Returns:
the FeatureMap of the processing resource

getController

Controller getController()
Provide access to the controller running the PR this action context lives in.

Returns:
the Controller resource

endPhase

boolean endPhase()
Request the current JAPE phase to be ended as soon as possible. After the current RHS code has returned, the phase will be ended as soon as possible if the JAPE implementation supports this feature. The method returns false if this feature is not supported or if it is known that ending the phase prematurely is not possible, true otherwise.

Returns:
true if ending the phase prematurely is supported, false otherwise