morphological segmentation implemented in scala