Revision: 15297
http://gate.svn.sourceforge.net/gate/?rev=15297&view=rev
Author: ian_roberts
Date: 2012-02-01 15:50:41 +0000 (Wed, 01 Feb 2012)
Log Message:
-----------
Proper documentation of the global variables available in a
ScriptableController script.
Modified Paths:
--------------
userguide/trunk/api.tex
Modified: userguide/trunk/api.tex
===================================================================
--- userguide/trunk/api.tex 2012-02-01 15:39:09 UTC (rev 15296)
+++ userguide/trunk/api.tex 2012-02-01 15:50:41 UTC (rev 15297)
@@ -2436,6 +2436,28 @@
\lstinline!SerialAnalyserController!, which runs its PRs once only rather than
once per document in the corpus.
+\subsubsect{Global variables}
+
+There are a number of variables that are pre-defined in the control script.
+\begin{description}
+\item[controller] (read-only) a reference to the {\tt ScriptableController}
+ object itself, providing access to its features etc.
+\item[prs] (read-only) an unmodifiable list of the processing resources in the
+ pipeline.
+\item[corpus] (read-write) a reference to the corpus (if any) currently set on
+ the controller, and over which any {\tt eachDocument} loops will iterate.
+ This variable is a direct ``alias'' to the controller's getCorpus/setCorpus
+ methods, so for example a script could build a new corpus (using a web
+ crawler or similar), then use {\tt eachDocument} to iterate over this corpus
+ and process the documents.
+\end{description}
+
+In addition, as mentioned above, within the scope of an {\tt eachDocument} loop
+there is a ``doc'' variable giving access to the document being processed in
+the current iteration. Note that if this controller is nested inside another
+controller (see the previous section) then the ``doc'' variable will be
+available throughout the script.
+
\subsubsect{Ignoring errors}
By default, if an exception or error occurs while processing (either thrown by
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs