partitions an array of words into groups according to the first letter of each word.