Aranea::Shell
CONTENTS
Aranea::Shell
- the XML Shell for connecting Aranea
modules together
my $modules = [ "CreateObject", ... "ConvertToTREC" ];
my $args = ["Where is Belize located", 202];
my $shell = Aranea::Shell->new(MODULES => $modules,
ARGS => $args);
$shell->load_modules();
my $Aranea = $shell->execute(); |
|
This Perl module provides the glue that binds the Aranea modules
together, through the shared Aranea::XML::Aranea
object.
Because all Aranea modules have the exact same input/output behavior,
it is possible to automate the process of running a series of modules
in sequence. The Aranea::Shell
object provides the necessary
infrastructure and support for such a task.
new(named ARGS)
-
Constructs a new Aranea Shell. The constructor takes (optional) named
arguments:
MODULES
-
Listref to modules to execute. The shell assumes that the fully
qualified name of the module is
Aranea::Modules::MyModule
.
ARGS
-
Listref to arguments that should be passed into the first Aranea
module. The first module that the shell executes must be treated
differently from the rest (i.e., some part of the program must be
responsible for creating the initial XML object or reading it in from
file/stdout). If the
ARGS
argument is specified, the shell
deferences the listref and passes the list as the arguments of the
first module. For example, the module CreateObject
generates an
empty Aranea XML object with only the question number and the question
text:
-
my $modules = [ "CreateObject", ... ];
my $args = [ "where is Belize located?", 202 ];
my $shell = Aranea::Shell->new(MODULES => $modules,
ARGS => $args); |
|
FILE
-
Scalar value specifying the filename containing the Aranea XML object
to be read. The specified XML file will read and parsed into an
Aranea XML object. Here is a sample call:
-
my $shell = Aranea::Shell->new(MODULES => $modules,
FILE => "foo.xml"); |
|
Optionally, one can construct an empty Aranea Shell and then populate
the parameters using corresponding mutator methods.
MODULES([$listref])
-
Accesses or mutates the listref of modules to run with this Aranea
Shell.
ARGS([$listref])
-
Accesses or mutates the listref or parameters to pass into the first
module of the Aranea Shell.
FILE([$filename])
-
Accesses or mutates the name of tile XML file that should serve as
input to the first module of the Aranea Shell.
load_modules()
-
Loads the modules indicated in this Aranea Shell object. Note that
this method only needs to invoked once per instance of the Aranea
Shell.
execute()
-
Runs the Aranea shell. This method assumes proper setup: all modules
have been loaded, and a valid method exists for starting the pipeline.