Caching word segmentation