Text this: Direct least squares fitting of ellipses segmentation and prioritized rules classification for curve-shaped chart patterns