Insert spaces in a string given a dictionary