Nominal predictor to be used in regression

Got it. As another question, how do I maintain the mapping of indexes between the test and train data set for a nominal predictor?