A Generalized Approach to Word Segmentation Using Maximum