Pattern Language Recognition and Generation