From e455d580ab4d837122a4186627ec109c4000d7c5 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Sun, 21 Jun 2026 09:29:20 +0200 Subject: Motus: detect if one letter in the proposition match a rule in a different location --- motus/js/motus.ml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'motus/js/motus.ml') 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 -- cgit v1.2.3