GetDumpSummaryCLI cli = new GetDumpSummaryCLI(args);
ProgressLogger pl = new ProgressLogger("dumped {} titles", 10000);
cli.openOutput();
RecordReader<Article> reader = new RecordReader<Article>(
cli.getInput(), new JsonRecordParser<Article>(Article.class));
ArticleSummarizer summarizer = new ArticleSummarizer();
for (Article a : reader) {
pl.up();
cli.writeInOutput(a.getTypeName());
cli.writeInOutput(TAB);
cli.writeInOutput(String.valueOf(a.getWikiId()));
cli.writeInOutput(TAB);
cli.writeInOutput(a.getWikiTitle());
cli.writeInOutput(TAB);
if (a.isRedirect()) {
cli.writeInOutput("-> " + a.getRedirect());
} else {
cli.writeInOutput(summarizer.getSummary(a));
}
cli.writeInOutput("\n");
}
cli.closeOutput();