An implementation of the CYK algorithm