let texte f = let c = open_in f in let minuscule c = if c<=`Z` && c >= `A` then char_of_int( int_of_char c - int_of_char `A` + int_of_char `a`) else c in let rec foo s i = if i == string_length s then ("",[]) else let (mot,suite) = foo s (i+1) in if s.[i] == ` ` && mot != "" then ("",mot::suite) else if (s.[i] <= `Z` && s.[i] >= `A`) || (s.[i] <= `z` && s.[i] >= `a`) then (string_of_char (minuscule s.[i])^mot,suite) else (mot,suite) in let decoupe s = if s<>"" && s.[0] = `*` then failwith "" else let (a,b) = foo s 0 in if a = "" then b else a::b in let texte = ref [] in try while (let lin = (input_line c) in lin="" || lin.[0]<>`*`) do done; while(true) do texte := (decoupe (input_line c))::(!texte) done; [] with _ -> (it_list (fun x y -> y@x) [] !texte) ;;