| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Treex::Block::Util::SetGlobal; |
|
2
|
|
|
|
|
|
|
$Treex::Block::Util::SetGlobal::VERSION = '2.20160630'; |
|
3
|
1
|
|
|
1
|
|
6
|
use Moose; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
10
|
|
|
4
|
1
|
|
|
1
|
|
6560
|
use Treex::Core::Common; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
|
|
extends 'Treex::Core::Block'; |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub BUILD { |
|
8
|
7
|
|
|
7
|
0
|
104
|
my ( $self, $arg_ref ) = @_; |
|
9
|
7
|
50
|
|
|
|
69
|
my $scenario = $arg_ref->{scenario} or log_fatal "no scenario given"; |
|
10
|
7
|
|
|
|
|
18
|
while ( my ( $name, $value ) = each %{$arg_ref} ) { |
|
|
22
|
|
|
|
|
90
|
|
|
11
|
15
|
100
|
|
|
|
47
|
if ( $name ne 'scenario' ) { |
|
12
|
8
|
|
|
|
|
273
|
$scenario->set_global_param( $name, $value ); |
|
13
|
|
|
|
|
|
|
} |
|
14
|
|
|
|
|
|
|
} |
|
15
|
7
|
|
|
|
|
21
|
return; |
|
16
|
|
|
|
|
|
|
} |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub process_document { |
|
19
|
0
|
|
|
0
|
1
|
|
return 1; |
|
20
|
|
|
|
|
|
|
} |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
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.20160630 |
|
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. |