Detecting Handwriting Primitives in Cursive Words by Stroke Sequence Matching