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/reload.ml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'motus/js/reload.ml') diff --git a/motus/js/reload.ml b/motus/js/reload.ml index 912141d..2a12819 100644 --- a/motus/js/reload.ml +++ b/motus/js/reload.ml @@ -8,28 +8,25 @@ let process : t -> State.state -> State.state = fun () state -> (* Get the word corresponding to the proposition *) let word = - state.State.current_prop - |> List.to_seq + state.State.current_prop |> List.to_seq |> Seq.map (fun opt -> - match opt with - | None -> ' ' - | Some (letter, _) -> String.get (Jstr.to_string letter) 0 ) + match opt with + | None -> ' ' + | Some (letter, _) -> String.get (Jstr.to_string letter) 0) |> String.of_seq in let new_state = - { state with - analysis = Motus_lib.Wordlist.remove_word state.analysis word + { + state with + candidates = Motus_lib.Wordlist.remove_word state.candidates word ; catalog = Motus_lib.Wordlist.remove_word state.catalog word } in (* Get the new proposition if any *) let current_prop = - Initialize.get_proposition - ~catalog:new_state.catalog - state.length - new_state.analysis - state.rules + Initialize.get_proposition ~catalog:new_state.catalog state.length + new_state.candidates state.rules in match current_prop with | None -> new_state -- cgit v1.2.3