File Coverage

blib/lib/Bag/Similarity/Dice.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 16 16 100.0


line stmt bran cond sub pod time code
1             package Bag::Similarity::Dice;
2              
3 2     2   815 use strict;
  2         4  
  2         85  
4 2     2   11 use warnings;
  2         3  
  2         79  
5              
6 2     2   448 use parent 'Bag::Similarity';
  2         392  
  2         18  
7              
8             our $VERSION = '0.021';
9              
10             sub from_bags {
11 19     19 1 50 my ($self, $set1, $set2) = @_;
12            
13             # $dice = ($intersection * 2 / $combined_length);
14             return (
15 19         53 $self->intersection($set1,$set2) * 2 / $self->combined_length($set1,$set2)
16             );
17             }
18              
19             1;
20              
21              
22             __END__