A Line-Oriented Approach to Word Spotting in Handwritten Documents