| 1 | package Treex::Block::Util::SetGlobal; | ||||||||||
| 2 | { | ||||||||||
| 3 | 18 | $Treex::Block::Util::SetGlobal::VERSION = '0.08633_1'; | |||||||||
| 4 | } | ||||||||||
| 5 | 18 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 18 | ▶ | use Treex::Core::Common; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 18 | extends 'Treex::Core::Block'; | |||||||||
| 8 | |||||||||||
| 9 | sub BUILD { | ||||||||||
| 10 | 21 | ▶ | my ( $self, $arg_ref ) = @_; | ||||||||
|
Subroutine
BUILD: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||
| 11 | 21 | ▶ | my $scenario = $arg_ref->{scenario} or log_fatal "no scenario given"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | 21 | ▶ | while ( my ( $name, $value ) = each %{$arg_ref} ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 43 | ▶ | if ( $name ne 'scenario' ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 22 | $scenario->set_global_param( $name, $value ); | |||||||||
| 15 | } | ||||||||||
| 16 | } | ||||||||||
| 17 | 21 | return; | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | sub process_document { | ||||||||||
| 21 | 16 | ▶ | return 1; | ||||||||
|
Subroutine
process_document: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 18 | 1; | |||||||||
| 25 | |||||||||||
| 26 | __END__ | ||||||||||
| 27 | |||||||||||
| 28 | =head1 NAME | ||||||||||
| 29 | |||||||||||
| 30 | Treex::Block::Util::SetGlobal | ||||||||||
| 31 | |||||||||||
| 32 | =head1 VERSION | ||||||||||
| 33 | |||||||||||
| 34 | version 0.08633_1 | ||||||||||
| 35 | |||||||||||
| 36 | =head1 DESCRIPTION | ||||||||||
| 37 | |||||||||||
| 38 | Special block for setting global parameters in scenarios. E.g., instead of: | ||||||||||
| 39 | |||||||||||
| 40 | Read::PlainText language=en from=file.txt | ||||||||||
| 41 | W2A::Tokenize language=en | ||||||||||
| 42 | W2A::Tag language=en | ||||||||||
| 43 | ... | ||||||||||
| 44 | |||||||||||
| 45 | you can write: | ||||||||||
| 46 | |||||||||||
| 47 | Util::SetGlobal language=en | ||||||||||
| 48 | Read::PlainText from=file.txt | ||||||||||
| 49 | W2A::Tokenize | ||||||||||
| 50 | W2A::Tag | ||||||||||
| 51 | ... | ||||||||||
| 52 | |||||||||||
| 53 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 54 | |||||||||||
| 55 | Copyright © 2011 by Institute of Formal and Applied Linguistics, Charles University in Prague | ||||||||||
| 56 | |||||||||||
| 57 | This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. | ||||||||||