OCaml code for inverted-index and word-count recursive