line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Treex::PML::StandardFactory; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
911
|
use 5.008; |
|
1
|
|
|
|
|
3
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
15
|
|
5
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
20
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
3
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
8
|
|
|
|
|
|
|
BEGIN { |
9
|
1
|
|
|
1
|
|
15
|
$VERSION='2.21'; # version template |
10
|
|
|
|
|
|
|
} |
11
|
1
|
|
|
1
|
|
3
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
41
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
7
|
use base qw(Treex::PML::Factory); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
55
|
|
14
|
1
|
|
|
1
|
|
4
|
use UNIVERSAL::DOES; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
27
|
|
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
6
|
use Treex::PML::Struct; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
17
|
|
17
|
1
|
|
|
1
|
|
3
|
use Treex::PML::Container; |
|
1
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
12
|
|
18
|
1
|
|
|
1
|
|
3
|
use Treex::PML::Alt; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
19
|
1
|
|
|
1
|
|
3
|
use Treex::PML::List; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
11
|
|
20
|
1
|
|
|
1
|
|
2
|
use Treex::PML::Seq; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
13
|
|
21
|
1
|
|
|
1
|
|
30
|
use Treex::PML::Node; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use Treex::PML::FSFormat; |
23
|
|
|
|
|
|
|
use Treex::PML::Document; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub createPMLSchema { |
26
|
|
|
|
|
|
|
my $self = shift; |
27
|
|
|
|
|
|
|
return Treex::PML::Schema->new(@_); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub createPMLInstance { |
31
|
|
|
|
|
|
|
my $self = shift; |
32
|
|
|
|
|
|
|
if (@_) { |
33
|
|
|
|
|
|
|
return $self->createPMLInstance()->load(@_); |
34
|
|
|
|
|
|
|
} else { |
35
|
|
|
|
|
|
|
return Treex::PML::Instance->new(); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub createDocument { |
40
|
|
|
|
|
|
|
my $self = shift; |
41
|
|
|
|
|
|
|
return Treex::PML::Document->new(@_); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub createDocumentFromFile { |
45
|
|
|
|
|
|
|
my $self = shift; |
46
|
|
|
|
|
|
|
return $self->createDocument->load(@_); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub createFSFormat { |
50
|
|
|
|
|
|
|
my $self = shift; |
51
|
|
|
|
|
|
|
return Treex::PML::FSFormat->new(@_); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub createNode { |
55
|
|
|
|
|
|
|
my $self=shift; |
56
|
|
|
|
|
|
|
return Treex::PML::Node->new(@_); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub createTypedNode { |
60
|
|
|
|
|
|
|
my $self = shift; |
61
|
|
|
|
|
|
|
my $node; |
62
|
|
|
|
|
|
|
if (@_>1 and !ref($_[0]) and UNIVERSAL::DOES::does($_[1],'Treex::PML::Schema')) { |
63
|
|
|
|
|
|
|
my $type = shift; |
64
|
|
|
|
|
|
|
my $schema = shift; |
65
|
|
|
|
|
|
|
$node = $self->createNode(@_); |
66
|
|
|
|
|
|
|
$node->set_type_by_name($schema,$type); |
67
|
|
|
|
|
|
|
} else { |
68
|
|
|
|
|
|
|
my $decl = shift; |
69
|
|
|
|
|
|
|
$node = $self->createNode(@_); |
70
|
|
|
|
|
|
|
$node->set_type($decl); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
return $node; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub createList { |
76
|
|
|
|
|
|
|
my $self = shift; |
77
|
|
|
|
|
|
|
return @_>0 ? Treex::PML::List->new_from_ref(@_) : Treex::PML::List->new(); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub createSeq { |
81
|
|
|
|
|
|
|
my $self = shift; |
82
|
|
|
|
|
|
|
return Treex::PML::Seq->new(@_); |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub createAlt { |
86
|
|
|
|
|
|
|
my $self = shift; |
87
|
|
|
|
|
|
|
return @_>0 ? Treex::PML::Alt->new_from_ref(@_) : Treex::PML::Alt->new(); |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub createContainer { |
91
|
|
|
|
|
|
|
my $self = shift; |
92
|
|
|
|
|
|
|
return Treex::PML::Container->new(@_); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub createStructure { |
96
|
|
|
|
|
|
|
my $self = shift; |
97
|
|
|
|
|
|
|
return Treex::PML::Struct->new(@_); |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
1; |
102
|
|
|
|
|
|
|
__END__ |