token map function
make training input parsing a little more functional... and ugly