File Coverage

blib/lib/Lingua/YaTeA/LinguisticItem.pm
Criterion Covered Total %
statement 20 20 100.0
branch 2 2 100.0
condition n/a
subroutine 6 6 100.0
pod 4 4 100.0
total 32 32 100.0


line stmt bran cond sub pod time code
1             package Lingua::YaTeA::LinguisticItem;
2 5     5   26 use strict;
  5         9  
  5         114  
3 5     5   20 use warnings;
  5         7  
  5         854  
4              
5             our $VERSION=$Lingua::YaTeA::VERSION;
6              
7             sub new
8             {
9 40     40 1 77 my ($class,$type,$form) = @_;
10 40         54 my $this = {};
11 40         57 bless ($this,$class);
12 40         84 $this->{TYPE} = $type;
13 40         73 $this->{FORM} = $form;
14 40         81 return $this;
15             }
16              
17             sub getForm
18             {
19 124     124 1 199 my ($this) = @_;
20 124         316 return $this->{FORM};
21             }
22              
23             sub getType
24             {
25 124     124 1 162 my ($this) = @_;
26 124         280 return $this->{TYPE};
27             }
28              
29             sub matchesWord
30             {
31 96     96 1 166 my ($this,$word) = @_;
32 96 100       140 if($this->getForm eq $word->getLexItem->getAny($this->getType))
33             {
34 50         195 return 1;
35             }
36 46         137 return 0;
37             }
38             1;
39              
40             __END__