Skip to content

Commit 7a21987

Browse files
committed
WIP
1 parent e0dc2f6 commit 7a21987

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

t/01-deltas.t

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use Statistics::Krippendorff;
77
use List::Util qw{ sum };
88

99
use Test2::V0;
10-
plan 20;
10+
plan 21;
1111

1212
my $sk = 'Statistics::Krippendorff'->new(units => []);
1313

@@ -32,6 +32,8 @@ is $sk->delta_jaccard('b,a', 'a,c'), 2/3, 'ba ac';
3232

3333
is $sk->delta_jaccard('a,b,c', 'b,c,d,e'), 3/5, 'abc bcde';
3434

35+
is $sk->delta_masi('1,2', '1,2,3,4'), 2/3, 'masi';
36+
3537
my @figures = (
3638
[['x,y', 'x,y,z'], ['x,y', 'x,y,z'], ['x', 'x,y,z']],
3739
[['x,y', 'x'], ['x,y', 'y,z'], ['z', 'y,z']]
@@ -42,14 +44,16 @@ my %means = (jaccard => [4 / 9, 5 / 9],
4244
for my $figure_index (0 .. $#figures) {
4345
my $figure = $figures[$figure_index];
4446
my @jaccard_deltas = map $sk->delta_jaccard(@$_), @$figure;
45-
my $mean = sum(@jaccard_deltas) / @jaccard_deltas;
46-
is $mean, shift @{ $means{jaccard} }, "fig$figure_index jaccard mean";
47+
my $j_mean = sum(@jaccard_deltas) / @jaccard_deltas;
48+
is $j_mean, shift @{ $means{jaccard} }, "fig$figure_index jaccard mean";
4749

4850
if (1 == $figure_index) {
4951
$figure->[1] = ['x', 'z'];
52+
} else {
53+
#$figure = [['y', 'y,z'], ['x', 'x,z'], ['x','x,y']];
5054
}
5155

5256
my @masi_deltas = map $sk->delta_masi(@$_), @$figure;
53-
my $mean = 1 - sum(@masi_deltas) / @masi_deltas;
54-
is $mean, shift @{ $means{masi} }, "fig$figure_index masi mean";
57+
my $m_mean = 1 - sum(@masi_deltas) / @masi_deltas;
58+
is $m_mean, shift @{ $means{masi} }, "fig$figure_index masi mean";
5559
}

0 commit comments

Comments
 (0)