From 3235260a3dca98e96ab50458a5daf3baf3f238d0 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Sun, 27 Feb 2022 10:31:27 +0100 Subject: Do not evaluate the entropy when only 2 words are still presents --- motus/js/initialize.ml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'motus/js') diff --git a/motus/js/initialize.ml b/motus/js/initialize.ml index 9375880..b721343 100644 --- a/motus/js/initialize.ml +++ b/motus/js/initialize.ml @@ -28,14 +28,9 @@ let get_proposition : let elements = Wordlist.list_size wordlist in if elements > 2000 then Freq_analysis.analyse wordlist |> Freq_analysis.pick_next_word wordlist - else if elements > 1 - then + else let _, word = Entropy.analyse length ~catalog wordlist in word - else - match Wordlist.pick wordlist with - | Some w -> w - | None -> "" in match String.equal String.empty word with | true -> None -- cgit v1.2.3