let t = Hashtbl.create 10000;; let ch = open_in Sys.argv.(1);; let splitter = Str.regexp "[ \t]+";; try while true do let line = input_line ch in let wordlist = Str.split splitter line in let incword w = Hashtbl.replace t w (try (Hashtbl.find t w) + 1 with Not_found -> 1) in List.map incword wordlist done with End_of_file -> ();; let ch2 = open_in "/usr/share/dict/words";; try while true do let word = input_line ch2 in if Hashtbl.mem t word then Printf.printf "%s: %d\n" word (Hashtbl.find t word) done with End_of_file -> ();;