blib/lib/Set/Similarity/BV/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 Set::Similarity::BV::Dice; | ||||||
2 | |||||||
3 | 1 | 1 | 836 | use strict; | |||
1 | 2 | ||||||
1 | 31 | ||||||
4 | 1 | 1 | 4 | use warnings; | |||
1 | 1 | ||||||
1 | 38 | ||||||
5 | |||||||
6 | 1 | 1 | 525 | use parent 'Set::Similarity::BV'; | |||
1 | 338 | ||||||
1 | 7 | ||||||
7 | |||||||
8 | our $VERSION = '0.06'; | ||||||
9 | |||||||
10 | sub from_integers { | ||||||
11 | 5 | 5 | 1 | 7 | my ($self, $v1, $v2) = @_; | ||
12 | |||||||
13 | # $dice = ($intersection * 2 / $combined_length); | ||||||
14 | return ( | ||||||
15 | 5 | 17 | $self->intersection($v1,$v2) * 2 / $self->combined_length($v1,$v2) | ||||
16 | ); | ||||||
17 | } | ||||||
18 | |||||||
19 | 1; | ||||||
20 | |||||||
21 | __END__ |