linguistic generation algorithm