derekovecs: default to min_analyzed(lD)-0.1 if reference collocate is not analyzed
diff --git a/w2v-server.pl b/w2v-server.pl
index 8bf0f14..2f402ec 100755
--- a/w2v-server.pl
+++ b/w2v-server.pl
@@ -140,12 +140,14 @@
my $d1 = decode_json($cccache{$word});
my $d2 = decode_json($s2);
my %d2ld;
+ my $minLd = 14;
foreach my $i (@{$d2->{collocates}}) {
$d2ld{$i->{word}}=$i->{ld};
+ $minLd=$i->{ld} if($i->{ld} < $minLd);
}
foreach my $i (@{$d1->{collocates}}) {
my $w = $i->{word};
- $i->{delta} = $i->{ld} - (defined $d2ld{$w} ? $d2ld{$w} : 0);
+ $i->{delta} = $i->{ld} - (defined $d2ld{$w} ? $d2ld{$w} : $minLd-0.1);
}
return(encode_json($d1));
} else {