Implementation of 1$ recognizer