line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Treex::PML::StandardFactory; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
151
|
use 5.008; |
|
6
|
|
|
|
|
23
|
|
4
|
6
|
|
|
6
|
|
30
|
use strict; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
111
|
|
5
|
6
|
|
|
6
|
|
26
|
use warnings; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
198
|
|
6
|
|
|
|
|
|
|
|
7
|
6
|
|
|
6
|
|
35
|
use vars qw($VERSION); |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
342
|
|
8
|
|
|
|
|
|
|
BEGIN { |
9
|
6
|
|
|
6
|
|
158
|
$VERSION='2.24'; # version template |
10
|
|
|
|
|
|
|
} |
11
|
6
|
|
|
6
|
|
40
|
use Carp; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
352
|
|
12
|
|
|
|
|
|
|
|
13
|
6
|
|
|
6
|
|
34
|
use base qw(Treex::PML::Factory); |
|
6
|
|
|
|
|
21
|
|
|
6
|
|
|
|
|
766
|
|
14
|
6
|
|
|
6
|
|
40
|
use UNIVERSAL::DOES; |
|
6
|
|
|
|
|
22
|
|
|
6
|
|
|
|
|
316
|
|
15
|
|
|
|
|
|
|
|
16
|
6
|
|
|
6
|
|
39
|
use Treex::PML::Struct; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
166
|
|
17
|
6
|
|
|
6
|
|
2249
|
use Treex::PML::Container; |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
150
|
|
18
|
6
|
|
|
6
|
|
2082
|
use Treex::PML::Alt; |
|
6
|
|
|
|
|
18
|
|
|
6
|
|
|
|
|
166
|
|
19
|
6
|
|
|
6
|
|
2233
|
use Treex::PML::List; |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
194
|
|
20
|
6
|
|
|
6
|
|
2236
|
use Treex::PML::Seq; |
|
6
|
|
|
|
|
16
|
|
|
6
|
|
|
|
|
182
|
|
21
|
6
|
|
|
6
|
|
43
|
use Treex::PML::Node; |
|
6
|
|
|
|
|
19
|
|
|
6
|
|
|
|
|
135
|
|
22
|
6
|
|
|
6
|
|
33
|
use Treex::PML::FSFormat; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
126
|
|
23
|
6
|
|
|
6
|
|
27
|
use Treex::PML::Document; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
2734
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub createPMLSchema { |
26
|
47
|
|
|
47
|
1
|
131
|
my $self = shift; |
27
|
47
|
|
|
|
|
575
|
return Treex::PML::Schema->new(@_); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub createPMLInstance { |
31
|
88
|
|
|
88
|
1
|
199
|
my $self = shift; |
32
|
88
|
100
|
|
|
|
258
|
if (@_) { |
33
|
27
|
|
|
|
|
113
|
return $self->createPMLInstance()->load(@_); |
34
|
|
|
|
|
|
|
} else { |
35
|
61
|
|
|
|
|
329
|
return Treex::PML::Instance->new(); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub createDocument { |
40
|
25
|
|
|
25
|
1
|
56
|
my $self = shift; |
41
|
25
|
|
|
|
|
263
|
return Treex::PML::Document->new(@_); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub createDocumentFromFile { |
45
|
25
|
|
|
25
|
1
|
3125
|
my $self = shift; |
46
|
25
|
|
|
|
|
109
|
return $self->createDocument->load(@_); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub createFSFormat { |
50
|
27
|
|
|
27
|
1
|
62
|
my $self = shift; |
51
|
27
|
|
|
|
|
205
|
return Treex::PML::FSFormat->new(@_); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub createNode { |
55
|
11235
|
|
|
11235
|
1
|
17030
|
my $self=shift; |
56
|
11235
|
|
|
|
|
30896
|
return Treex::PML::Node->new(@_); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub createTypedNode { |
60
|
11235
|
|
|
11235
|
1
|
18077
|
my $self = shift; |
61
|
11235
|
|
|
|
|
16177
|
my $node; |
62
|
11235
|
50
|
66
|
|
|
54911
|
if (@_>1 and !ref($_[0]) and UNIVERSAL::DOES::does($_[1],'Treex::PML::Schema')) { |
|
|
|
33
|
|
|
|
|
63
|
0
|
|
|
|
|
0
|
my $type = shift; |
64
|
0
|
|
|
|
|
0
|
my $schema = shift; |
65
|
0
|
|
|
|
|
0
|
$node = $self->createNode(@_); |
66
|
0
|
|
|
|
|
0
|
$node->set_type_by_name($schema,$type); |
67
|
|
|
|
|
|
|
} else { |
68
|
11235
|
|
|
|
|
17927
|
my $decl = shift; |
69
|
11235
|
|
|
|
|
22720
|
$node = $self->createNode(@_); |
70
|
11235
|
|
|
|
|
27057
|
$node->set_type($decl); |
71
|
|
|
|
|
|
|
} |
72
|
11235
|
|
|
|
|
21201
|
return $node; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub createList { |
76
|
15900
|
|
|
15900
|
1
|
26844
|
my $self = shift; |
77
|
15900
|
100
|
|
|
|
58449
|
return @_>0 ? Treex::PML::List->new_from_ref(@_) : Treex::PML::List->new(); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub createSeq { |
81
|
665
|
|
|
665
|
1
|
1157
|
my $self = shift; |
82
|
665
|
|
|
|
|
2449
|
return Treex::PML::Seq->new(@_); |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub createAlt { |
86
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
87
|
0
|
0
|
|
|
|
0
|
return @_>0 ? Treex::PML::Alt->new_from_ref(@_) : Treex::PML::Alt->new(); |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub createContainer { |
91
|
207
|
|
|
207
|
1
|
377
|
my $self = shift; |
92
|
207
|
|
|
|
|
748
|
return Treex::PML::Container->new(@_); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub createStructure { |
96
|
15488
|
|
|
15488
|
1
|
23534
|
my $self = shift; |
97
|
15488
|
|
|
|
|
40746
|
return Treex::PML::Struct->new(@_); |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
1; |
102
|
|
|
|
|
|
|
__END__ |