line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Treex::Block::Util::SetGlobal; |
2
|
|
|
|
|
|
|
$Treex::Block::Util::SetGlobal::VERSION = '2.20210102'; |
3
|
2
|
|
|
2
|
|
15
|
use Moose; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
32
|
|
4
|
2
|
|
|
2
|
|
16076
|
use Treex::Core::Common; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
32
|
|
5
|
|
|
|
|
|
|
extends 'Treex::Core::Block'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub BUILD { |
8
|
8
|
|
|
8
|
0
|
121
|
my ( $self, $arg_ref ) = @_; |
9
|
8
|
50
|
|
|
|
155
|
my $scenario = $arg_ref->{scenario} or log_fatal "no scenario given"; |
10
|
8
|
|
|
|
|
21
|
while ( my ( $name, $value ) = each %{$arg_ref} ) { |
|
25
|
|
|
|
|
110
|
|
11
|
17
|
100
|
|
|
|
65
|
if ( $name ne 'scenario' ) { |
12
|
9
|
|
|
|
|
392
|
$scenario->set_global_param( $name, $value ); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
} |
15
|
8
|
|
|
|
|
37
|
return; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub process_document { |
19
|
1
|
|
|
1
|
1
|
3
|
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.20210102 |
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. |