private void button1_Click(object sender, EventArgs e) { text = InputText.Text.ToString(); option = OutputType.Text.ToString(); if (text != "") { PWF = new PleaseWaitForm(); PWF.Show(); this.Visible = false; var annotation = new Annotation(text); pipeline.annotate(annotation); using (var stream = new ByteArrayOutputStream()) { if (option == "Pretty") { pipeline.prettyPrint(annotation, new PrintWriter(stream)); } else if (option == "Json") { pipeline.jsonPrint(annotation, new PrintWriter(stream)); } else if (option == "XML") { pipeline.xmlPrint(annotation, new PrintWriter(stream)); } else if (option == "Conll") { pipeline.conllPrint(annotation, new PrintWriter(stream)); } else { pipeline.conllPrint(annotation, new PrintWriter(stream)); } OutputText.Text = stream.ToString(); stream.close(); } PWF.Close(); this.Visible = true; } }