Source

OCaml Map Reduce Project / apps / inverted_index / mapper.ml

1
2
3
let (key, value) = Program.get_input() in
Program.set_output (List.fold_left (fun acc k -> (k, key)::acc) []
                   (List.map String.lowercase (Util.split_words value)))