File Coverage

blib/lib/Lingua/YaTeA/ParsingPattern.pm
Criterion Covered Total %
statement 40 55 72.7
branch n/a
condition n/a
subroutine 12 16 75.0
pod 10 10 100.0
total 62 81 76.5


line stmt bran cond sub pod time code
1             package Lingua::YaTeA::ParsingPattern;
2 5     5   33 use strict;
  5         7  
  5         114  
3 5     5   20 use warnings;
  5         7  
  5         106  
4              
5 5     5   1784 use Lingua::YaTeA::NodeSet;
  5         12  
  5         48  
6 5     5   1829 use Lingua::YaTeA::InternalNode;
  5         13  
  5         50  
7 5     5   1961 use Lingua::YaTeA::RootNode;
  5         11  
  5         40  
8 5     5   1699 use Lingua::YaTeA::PatternLeaf;
  5         12  
  5         41  
9             # use Data::Dumper;
10            
11             our $VERSION=$Lingua::YaTeA::VERSION;
12              
13             sub new
14             {
15 280     280 1 595 my ($class,$parse,$pos_sequence,$node_set,$priority,$direction,$num_content_words,$num_line) = @_;
16 280         404 my $this = {};
17 280         414 bless ($this,$class);
18 280         511 $this->{PARSE} = $parse;
19 280         413 $this->{PRIORITY} = $priority;
20 280         387 $this->{PARSING_DIRECTION} = $direction;
21 280         383 $this->{DECLARATION_LINE} = $num_line;
22 280         374 $this->{POS_SEQUENCE} = $pos_sequence;
23 280         418 $this->{NODE_SET} = $node_set;
24 280         357 $this->{CONTENT_WORDS} = $num_content_words;
25 280         476 return $this;
26             }
27              
28             sub setNodeSet
29             {
30 0     0 1 0 my ($this,$node_set) = @_;
31 0         0 $this->{NODE_SET} = $node_set;
32             }
33              
34              
35              
36             sub getParse
37             {
38 0     0 1 0 my ($this) = @_;
39 0         0 return $this->{PARSE};
40             }
41              
42              
43             sub getLength
44             {
45 64     64 1 99 my ($this) = @_;
46 64         136 my @array = split (/ /, $this->getPOSSequence);
47 64         205 return scalar @array;
48             }
49              
50              
51             sub getPriority
52             {
53 0     0 1 0 my ($this) = @_;
54 0         0 return $this->{PRIORITY};
55             }
56              
57             sub getDirection
58             {
59 4     4 1 9 my ($this) = @_;
60 4         18 return $this->{PARSING_DIRECTION};
61             }
62              
63             sub getNodeSet
64             {
65 110     110 1 164 my ($this) = @_;
66 110         309 return $this->{NODE_SET};
67             }
68              
69             sub getNumContentWords
70             {
71 6     6 1 10 my ($this) = @_;
72 6         15 return $this->{CONTENT_WORDS};
73             }
74              
75             sub getPOSSequence
76             {
77 624     624 1 815 my ($this) = @_;
78 624         1386 return $this->{POS_SEQUENCE};
79             }
80              
81             sub print
82             {
83 0     0 1   my ($this) = @_;
84            
85 0           print "\t[\n";
86 0           print "\tPARSE: " . $this->getParse . "\n";
87 0           print "\tPOS: " . $this->getPOSSequence . "\n";
88 0           print "\tPRIORITY: " . $this->getPriority . "\n";
89 0           print "\tPARSING_DIRECTION: " . $this->getDirection . "\n";
90 0           print "\tNODE_SET: \n";
91 0           $this->getNodeSet->print;
92 0           print "]\n";
93             }
94              
95              
96             1;
97              
98              
99             __END__