1. A method of generating test cases for a text annotator comprising: receiving a corpus of text fragments and a description of the text annotator, by executing first instructions in a computer system; determining types of inputs to the text annotator from the description, by executing second instructions in the computer system; analyzing language structures in the corpus to identify sentence types and grammar constructs, by executing third instructions in the computer system; and generating a first test case by performing a grammar tree transformation on a first selected fragment of the corpus based on the sentence types and the grammar constructs, by executing fourth instructions in the computer system.