diff options
author | Sébastien Dailly <sebastien@dailly.me> | 2022-02-24 08:59:44 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@dailly.me> | 2022-02-24 13:39:39 +0100 |
commit | c2bd6982e5ed845293a38ae600c239cd50924d76 (patch) | |
tree | 4e68d4e7f9c2b9d5ae597f54961891332fc0e985 /motus/lib/wordlist.mli | |
parent | 89dbb39c3fcd188ef7acf092061d756046b2c5d4 (diff) |
Update code, added tests
Diffstat (limited to 'motus/lib/wordlist.mli')
-rw-r--r-- | motus/lib/wordlist.mli | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/motus/lib/wordlist.mli b/motus/lib/wordlist.mli new file mode 100644 index 0000000..766fbdf --- /dev/null +++ b/motus/lib/wordlist.mli @@ -0,0 +1,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) *) |