aboutsummaryrefslogtreecommitdiff
path: root/motus/lib
diff options
context:
space:
mode:
Diffstat (limited to 'motus/lib')
-rw-r--r--motus/lib/entropy.ml10
1 files changed, 5 insertions, 5 deletions
diff --git a/motus/lib/entropy.ml b/motus/lib/entropy.ml
index fba14ce..5fcef6c 100644
--- a/motus/lib/entropy.ml
+++ b/motus/lib/entropy.ml
@@ -38,7 +38,7 @@ let get_entropy max_element words_number arr =
let ratio = content /. words_number in
entropy := !entropy -. (ratio *. Float.log2 ratio)
done;
- entropy
+ !entropy
let analyse : int -> catalog:Wordlist.t -> Wordlist.t -> t =
@@ -86,10 +86,10 @@ let analyse : int -> catalog:Wordlist.t -> Wordlist.t -> t =
word to if it belongs to the final list (it gives a small chance
to pick the right one…) *)
let is_better, already_picked =
- if !entropy > score
+ if entropy > score
then (true, false)
else if (not already_picked)
- && !entropy == score
+ && entropy == score
&& Wordlist.mem word_ref words
then (true, true)
else (false, already_picked)
@@ -100,8 +100,8 @@ let analyse : int -> catalog:Wordlist.t -> Wordlist.t -> t =
Printf.printf
"Q. of information when selecting %s : %f\n"
word_ref
- !entropy;
- (!entropy, word_ref, already_picked) )
+ entropy;
+ (entropy, word_ref, already_picked) )
else (score, word, already_picked) )
(-0., v, false)
(Wordlist.words catalog)