string recognizer now produces correct shortest lengths