A Hybrid Recognition Algorithm with Learning Capability and Its Application to an OCR System