HMM cursive handwriting recognition in c++