word segmentation from lines