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/next.ml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'motus/js/next.ml') diff --git a/motus/js/next.ml b/motus/js/next.ml index f26aa86..721c850 100644 --- a/motus/js/next.ml +++ b/motus/js/next.ml @@ -10,10 +10,9 @@ let process : t -> State.state -> State.state = let rules = State.get_current_rules state.current_prop in (* Update the word list with the new rules *) - let analysis = Motus_lib.Wordlist.filter rules state.analysis in - Printf.printf - "Number of elements after filter : %d\n" - (Motus_lib.Wordlist.list_size analysis); + let candidates = Motus_lib.Wordlist.filter rules state.candidates in + Printf.printf "Number of elements after filter : %d\n" + (Motus_lib.Wordlist.list_size candidates); let rules = Motus_lib.Criteria.merge_lists ~init:state.rules rules @@ -23,14 +22,13 @@ let process : t -> State.state -> State.state = let propositions = state.current_prop :: state.propositions and current_prop = [] in - let new_state = { state with propositions; current_prop; rules; analysis } in + let new_state = + { state with propositions; current_prop; rules; candidates } + in (* Get the new proposition if any *) let current_prop = - Initialize.get_proposition - ~catalog:state.catalog - state.length - analysis + Initialize.get_proposition ~catalog:state.catalog state.length candidates rules in match current_prop with -- cgit v1.2.3