Adding tokens to a map based on the first matching character