posOutputStream.close();
}
if (chunk || all) {
System.err.println("Training chunker");
ObjectStream<ChunkSample> ces = new ChunkSampleStream(new ParseSampleStream(new PlainTextByLineStream(new java.io.FileReader(inFile))));
ChunkerModel chunkModel = ChunkerME.train("en", ces, cutoff, iterations,
new ChunkContextGenerator());
System.out.println("Saving the chunker model as: " + chunkFile);
OutputStream chunkOutputStream = new FileOutputStream(chunkFile);
chunkModel.serialize(chunkOutputStream);