a point to segment str and add a default dict
fix bugs
add test