File Coverage

blib/lib/Lingua/YaTeA/Edge.pm
Criterion Covered Total %
statement 22 30 73.3
branch 3 8 37.5
condition 3 12 25.0
subroutine 6 8 75.0
pod 4 4 100.0
total 38 62 61.2


line stmt bran cond sub pod time code
1             package Lingua::YaTeA::Edge;
2 5     5   28 use strict;
  5         11  
  5         122  
3 5     5   21 use warnings;
  5         8  
  5         90  
4 5     5   17 use UNIVERSAL;
  5         14  
  5         19  
5 5     5   141 use Scalar::Util qw(blessed);
  5         10  
  5         1289  
6              
7             our $VERSION=$Lingua::YaTeA::VERSION;
8              
9              
10             sub new
11             {
12 858     858 1 1151 my ($class) = @_;
13 858         1187 my $this = {};
14 858         1143 bless ($this,$class);
15             #$this->{FATHER} = $father;
16             #$this->{POSITION} = "";
17 858         1454 return $this;
18             }
19              
20              
21             sub copyRecursively
22             {
23 222     222 1 323 my ($this,$new_set,$father) = @_;
24 222         248 my $new;
25 222 50 33     1156 if ((blessed($this)) && ($this->isa('Lingua::YaTeA::TermLeaf')))
26             {
27 0         0 return "";
28             }
29             else{
30 222 50 33     950 if ((blessed($this)) && ($this->isa('Lingua::YaTeA::InternalNode')))
31             {
32 0         0 return $this->copyRecursively($new_set,$father);
33             }
34             else{
35 222 50 33     905 if ((blessed($this)) && ($this->isa('Lingua::YaTeA::PatternLeaf')))
36             {
37 222         609 return "";
38             }
39             }
40             }
41             }
42              
43             sub update
44             {
45 0     0 1   my ($this,$new_value) = @_;
46 0           $this = $new_value;
47             }
48              
49              
50              
51             sub print
52             {
53 0     0 1   my ($this,$words_a,$fh) = @_;
54 0 0 0       if ((blessed($this)) && ($this->isa("Lingua::YaTeA::Node")))
55             {
56 0           print $fh "Node " . $this->getID;
57             }
58             else{
59 0           $this->printWords($words_a,$fh);
60             }
61             }
62              
63             1;
64              
65             __END__