Seol mar théacs é seo: Learning Algorithm for the Recursive Pattern Recognition Model