sentence error checking