From 84b8439aa90f1465d05dcba936a25eaf96f914a0 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Sat, 26 Feb 2022 13:42:32 +0100 Subject: Use the whole dictionnary when searching for a word for a faster exploration --- motus/lib/validity.ml | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'motus/lib/validity.ml') diff --git a/motus/lib/validity.ml b/motus/lib/validity.ml index 0fdc40c..3964e0b 100644 --- a/motus/lib/validity.ml +++ b/motus/lib/validity.ml @@ -57,32 +57,6 @@ let sequence : int -> t array Seq.t = 0 -module CharSet = Set.Make (Char) - -let compare_words : string -> ref:string * CharSet.t -> t array option = - fun w1 ~ref -> - let wordRef = fst ref in - let l1 = String.length w1 in - if l1 <> String.length wordRef - then None - else - let result = - Array.init l1 ~f:(fun i -> - let c1 = String.get w1 i - and c2 = String.get wordRef i in - - let state = - if Char.equal c1 c2 - then Wellplaced - else if CharSet.mem c2 (snd ref) - then Misplaced - else Missing - in - state ) - in - Some result - - let to_criteria : char -> int -> t -> Criteria.t list -> Criteria.t list = fun c i t acc -> match t with -- cgit v1.2.3