aboutsummaryrefslogtreecommitdiff
path: root/motus/lib/wordlist.mli
blob: 766fbdf271fb94e365689df01d34168e9da2f226 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
type t

val words : t -> string list

val list_size : t -> int
(** Number of words in the list *)

val empty_data : unit -> t

val add_word : Criteria.t list -> t -> string -> t
(** Add a new word in the list. Check are made against the differents criteria in order to ensure that the word is valid *)

val remove_word : t -> string -> t
(** Remove a word from this list *)

val extract_freq : t -> (char * int) list
(** Evaluate the score for each char (lower is better) *)

val pick_next_word : t -> (char * int) list -> string * int
(** Get the word which with the most information in it.

The information is the score given to each character, representing each
frequency in the whole word list (lower is better). If the same letter is
present many times, we consider that succeding letters does not give any more
informations (do not consider the position here) *)