1. Nick Wade
  2. OCaml Map Reduce Project

Source

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

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