ADD split function for the categorical attributes using the sorted array.