mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-05 19:00:31 -05:00
18 lines
449 B
OCaml
Executable file
18 lines
449 B
OCaml
Executable file
#!/usr/bin/env ocaml
|
|
#use "tests/quick/.common.ml";;
|
|
#load "containers.cma";;
|
|
#load "containers_string.cma";;
|
|
#load "containers_io.cma";;
|
|
|
|
open Containers_string
|
|
|
|
let words =
|
|
CCIO.with_in "/usr/share/dict/words" CCIO.read_lines_l
|
|
|
|
let idx = List.fold_left
|
|
(fun idx s -> Levenshtein.Index.add idx s s)
|
|
Levenshtein.Index.empty words;;
|
|
|
|
Levenshtein.Index.retrieve ~limit:1 idx "hell"
|
|
|> Levenshtein.klist_to_list
|
|
|> List.iter print_endline;;
|