implement customized segmentor