aboutsummaryrefslogtreecommitdiff
path: root/motus/js/motus.ml
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2026-06-21 09:29:20 +0200
committerSébastien Dailly <sebastien@dailly.me>2026-06-21 09:29:20 +0200
commite455d580ab4d837122a4186627ec109c4000d7c5 (patch)
tree37e6292ae1d6a31f57e6b7cdbedf8e11e257aa5c /motus/js/motus.ml
parent5709ce369f815ca26d555a05e84cfd0b8dc311cf (diff)
Motus: detect if one letter in the proposition match a rule in a different locationHEADmaster
Diffstat (limited to 'motus/js/motus.ml')
-rw-r--r--motus/js/motus.ml11
1 files changed, 6 insertions, 5 deletions
diff --git a/motus/js/motus.ml b/motus/js/motus.ml
index 47ea15c..c1ac754 100644
--- a/motus/js/motus.ml
+++ b/motus/js/motus.ml
@@ -77,9 +77,9 @@ let main length_id send_id dictionnary_id proposition_id rules_id table_id
Elements.Transfert.get_content_from_url words
|> E.map (fun html_response ->
- State.App.dispatch
- (module Initialize)
- Initialize.{ length; html_response; sender; proposition }))
+ State.App.dispatch
+ (module Initialize)
+ Initialize.{ length; html_response; sender; proposition }))
send_btn
|> E.join
in
@@ -161,9 +161,10 @@ let main length_id send_id dictionnary_id proposition_id rules_id table_id
S.map
(fun ev ->
match
- (ev.State.current_prop, Motus_lib.Wordlist.list_size ev.State.analysis)
+ ( ev.State.current_prop
+ , Motus_lib.Wordlist.list_size ev.State.candidates )
with
- | [], _ | _, 1 -> Some (Jstr.v "true")
+ | [], _ | _, 1 | _, 0 -> Some (Jstr.v "true")
| _, _ -> None)
ev
in