Wordsegmentation code for handwritten documents