Treex::Core::Scenario - a larger Treex processing unit (composed of the basic treex processing units - blocks)
version 0.05222
use Treex::Core; my $scenario = Treex::Core::Scenario->new(from_file => 'myscenario.scen' ); $scenario->run;
A Treex scenario consists of a sequence of (possibly parametrized) Treex blocks.
Scenarios can be described by a simple textual format, which is either passed directly to the scenario construction, or is contained in a text file whose name is passed.
The string description of scenarios looks as follows.
1) It contains a list of block names from which their 'Treex::Block::' prefixes were removed.
2) The block names are separated by one or more whitespaces.
3) The block names are listed in the same order in which they should be applied on data.
4) For each block, there can be one or more parameters specified, using the attribute=value form.
5) Comments start with '#' and end with the nearest newline character.
Scenario example:
# morphological analysis of Util::SetGlobal language=en selector=src Read::Text W2A::ResegmentSentences W2A::EN::Tokenize W2A::EN::NormalizeForms W2A::EN::FixTokenization W2A::EN::TaggerMorce
Constructor parameter from_string specifies the names of blocks which are to be executed (in the specified order) when the scenario is applied on a Treex::Core::Document object.
from_string
The scenario description is loaded from the file.
Run the scenario. On of the blocks (usually the first one) must be the document reader (see Treex::Core::DocumentReader) that produces the documents on which this scenatio is applied.
loads a scenario description from a file
parses a textual description of a scenario
constructs a scenario textual description from an existing scenario instance
Treex::Core
Zdeněk Žabokrtský <zabokrtsky@ufal.mff.cuni.cz>
Martin Popel <popel@ufal.mff.cuni.cz>
David Mareček <marecek@ufal.mff.cuni.cz>
Copyright © 2011 by Institute of Formal and Applied Linguistics, Charles University in Prague
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Treex::Core, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Treex::Core
CPAN shell
perl -MCPAN -e shell install Treex::Core
For more information on module installation, please visit the detailed CPAN module installation guide.