Pattern primitive based Malayalam handwritten character recognition studies for real time application