line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Set::Similarity::BV::Jaccard; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1357
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
54
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
57
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
706
|
use parent 'Set::Similarity::BV'; |
|
1
|
|
|
|
|
602
|
|
|
1
|
|
|
|
|
7
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub from_integers { |
11
|
5
|
|
|
5
|
1
|
9
|
my ($self, $v1, $v2) = @_; |
12
|
|
|
|
|
|
|
|
13
|
5
|
|
|
|
|
36
|
my $intersection = $self->intersection($v1,$v2); |
14
|
5
|
|
|
|
|
21
|
my $union = $self->combined_length($v1,$v2) - $intersection; |
15
|
|
|
|
|
|
|
# ( A intersect B ) / (A union B) |
16
|
5
|
|
|
|
|
48
|
return ($intersection / $union); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
__END__ |