Treex/Block/Util/SetGlobal.pm

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