pipeline.prettyPrint(annotation, out); if (xmlOut != null) { pipeline.xmlPrint(annotation, xmlOut);
pipeline.prettyPrint(annotation, out); if (xmlOut != null) { pipeline.xmlPrint(annotation, xmlOut);
/** * Runs an interactive shell where input text is processed with the given pipeline * @param pipeline The pipeline to be used * @throws IOException If IO problem with stdin */ private static void shell(StanfordCoreNLP pipeline) throws IOException { BufferedReader is = new BufferedReader(new InputStreamReader(System.in)); PrintWriter os = new PrintWriter(System.out); System.out.println("Entering interactive shell. Type q to quit."); while(true){ System.out.print("NLP> "); String line = is.readLine(); if(line != null && line.length() > 0){ if(line.equalsIgnoreCase("q")) break; Annotation anno = pipeline.process(line); pipeline.prettyPrint(anno, os); } } }
} else if (outputFormat.equalsIgnoreCase("text")) { PrintWriter pw = new PrintWriter(EncodingFileWriter.getWriter(outputFilename, encoding)); prettyPrint(annotation, pw); pw.close(); } else {
break; case TEXT: pipeline.prettyPrint(anno, System.out); break; default:
pipeline.prettyPrint(annotation, out); if (xmlOut != null) { pipeline.xmlPrint(annotation, xmlOut);
prettyPrint(annotation, fos); fos.close(); break;