reading in dictionary of ways into prefix tree