aboutsummaryrefslogtreecommitdiff
path: root/motus/js
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2022-02-27 10:31:27 +0100
committerSébastien Dailly <sebastien@dailly.me>2022-02-27 10:31:27 +0100
commit3235260a3dca98e96ab50458a5daf3baf3f238d0 (patch)
treec27a36630a7297ef015eb8f93401657cfe96224d /motus/js
parent84b8439aa90f1465d05dcba936a25eaf96f914a0 (diff)
Do not evaluate the entropy when only 2 words are still presents
Diffstat (limited to 'motus/js')
-rw-r--r--motus/js/initialize.ml7
1 files changed, 1 insertions, 6 deletions
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