A system for automatic recognition of handwritten words