work out token with corresponding text