lib/Treex/Block/Util/SetGlobal.pm

filter: Statementstmt 100% 18 / 18 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 50.0% 1 / 2 totaltotal 93.3% 28 / 30 CC 4 SCAR 10.0
CC
4
Cov
96%
BUILD
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« lib/Treex/Core/Types.pm ↑ Summary lib/Treex/Block/Read/Sentences.pm »
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
BranchTrueFalseTotal
my $scenario = $arg_ref->{"scenario"} or log_fatal("no scenario given") 0 21 21
12 21 ▶ while ( my ( $name, $value ) = each %{$arg_ref} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %{$arg_ref;}) 43 21 64
13 43 ▶ if ( $name ne 'scenario' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name ne "scenario") 22 21 43
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.
« lib/Treex/Core/Types.pm ↑ Summary lib/Treex/Block/Read/Sentences.pm »