File Coverage

blib/lib/Lingua/YaTeA/ChunkingDataSubset.pm
Criterion Covered Total %
statement 21 33 63.6
branch 2 2 100.0
condition n/a
subroutine 6 12 50.0
pod 10 10 100.0
total 39 57 68.4


line stmt bran cond sub pod time code
1             package Lingua::YaTeA::ChunkingDataSubset;
2 5     5   26 use strict;
  5         9  
  5         113  
3 5     5   20 use warnings;
  5         8  
  5         1591  
4              
5             our $VERSION=$Lingua::YaTeA::VERSION;
6              
7             sub new
8             {
9 16     16 1 28 my ($class) = @_;
10 16         25 my $this = {};
11 16         21 bless ($this,$class);
12 16         40 $this->{IF} = {};
13 16         26 $this->{POS} = {};
14 16         22 $this->{LF} = {};
15 16         41 return $this;
16             }
17              
18             sub getIF
19             {
20 0     0 1 0 my ($this) = @_;
21 0         0 return $this->{IF};
22             }
23              
24             sub getPOS
25             {
26 0     0 1 0 my ($this) = @_;
27 0         0 return $this->{POS};
28             }
29              
30             sub getLF
31             {
32 0     0 1 0 my ($this) = @_;
33 0         0 return $this->{LF};
34             }
35              
36             sub getSome
37             {
38 21624     21624 1 27069 my ($this,$type) = @_;
39 21624         38731 return $this->{$type};
40             }
41              
42             sub addIF
43             {
44 0     0 1 0 my ($this,$value);
45 0         0 $this->{IF}->{$value}++;
46             }
47              
48             sub addPOS
49             {
50 0     0 1 0 my ($this,$value);
51 0         0 $this->{POS}->{$value}++;
52             }
53              
54             sub addLF
55             {
56 0     0 1 0 my ($this,$value);
57 0         0 $this->{LF}->{$value}++;
58             }
59              
60             sub addSome
61             {
62 244     244 1 372 my ($this,$type,$value) = @_;
63 244         3588 $this->{$type}->{$value}++;
64             }
65              
66             sub existData
67             {
68 21624     21624 1 30518 my ($this,$type,$value) = @_;
69 21624 100       30404 if(exists $this->getSome($type)->{$value})
70             {
71 4570         11405 return 1;
72             }
73 17054         37465 return 0;
74             }
75              
76             1;
77              
78             __END__