let exists_key key dict = match dict_find key dict with None -> false | _ -> true (* Exercice 5 *) (* 6. *) let rec dict_adds couples dict = match couples with [] -> dict | (k, v)::tl -> dict_adds tl (dict_add k v dict) (* Exercice 6 *) (* 7. *) let make_dict couples = dict_adds couples dict_empty (* Exercice 7 *) (* 8. *) let find_word word dict = match dict_find word dict with None -> "?" ^ word ^ "?" | Some w -> w (* Exercice 8 *) (* 9. *) let translate words dict = List.map (fun w -> find_word w dict) words