File Coverage

blib/lib/Lingua/YaTeA/Sentence.pm
Criterion Covered Total %
statement 21 25 84.0
branch n/a
condition n/a
subroutine 7 9 77.7
pod 7 7 100.0
total 35 41 85.3


line stmt bran cond sub pod time code
1             package Lingua::YaTeA::Sentence;
2 3     3   18 use strict;
  3         6  
  3         70  
3 3     3   27 use warnings;
  3         6  
  3         810  
4              
5             our $counter = 0;
6             our $in_doc_counter = 0;
7             our $start_char = 0;
8              
9             our $VERSION=$Lingua::YaTeA::VERSION;
10              
11             sub new
12             {
13 20     20 1 34 my ($class,$documents) = @_;
14 20         27 my $this = {};
15 20         32 bless ($this,$class);
16 20         45 $this->{ID} = $counter;
17 20         28 $this->{IN_DOC_ID} = $in_doc_counter;
18 20         48 $this->{DOCUMENT} = $documents->getCurrent;
19 20         45 return $this;
20             }
21              
22             sub resetInDocCounter
23             {
24 0     0 1 0 my ($class) = @_;
25 0         0 $in_doc_counter = 0;
26             }
27              
28             sub resetStartChar
29             {
30 18     18 1 37 my ($class) = @_;
31 18         39 $start_char = 0;
32             }
33              
34             sub updateStartChar
35             {
36 576     576 1 767 my ($class,$word) = @_;
37 576         904 $start_char += $word->getLexItem->getLength +1;
38             }
39              
40             sub getDocument
41             {
42 660     660 1 771 my ($this) = @_;
43 660         1198 return $this->{DOCUMENT};
44             }
45              
46             sub getID
47             {
48 0     0 1 0 my ($this) = @_;
49 0         0 return $this->{ID};
50             }
51              
52             sub getInDocID
53             {
54 330     330 1 402 my ($this) = @_;
55 330         714 return $this->{IN_DOC_ID};
56             }
57              
58              
59             1;
60              
61             __END__