Source:
public IndexCollection(IndexCollection.Args args) throws Exception { this.args = args; LOG.info("Collection path: " + args.input); LOG.info("Index path: " + args.index); LOG.info("CollectionClass: " + args.collectionClass); LOG.info("Generator: " + args.generatorClass); LOG.info("Threads: " + args.threads); LOG.info("Keep stopwords? " + args.keepStopwords); LOG.info("Store positions? " + args.storePositions); LOG.info("Store docvectors? " + args.storeDocvectors); LOG.info("Store transformed docs? " + args.storeTransformedDocs); LOG.info("Store raw docs? " + args.storeRawDocs); LOG.info("Optimize (merge segments)? " + args.optimize); LOG.info("Whitelist File: " + args.whitelistFile); this.indexPath = Paths.get(args.index); if (!Files.exists(this.indexPath)) { Files.createDirectories(this.indexPath); } collectionPath = Paths.get(args.input); if (!Files.exists(collectionPath) || !Files.isReadable(collectionPath) || !Files.isDirectory(collectionPath)) { throw new RuntimeException("Document directory " + collectionPath.toString() + " does not exist or is not readable, please check the path"); } this.transformerClass = Class.forName("io.anserini.index.generator." + args.generatorClass); this.collectionClass = Class.forName("io.anserini.collection." + args.collectionClass); collection = (Collection) this.collectionClass.newInstance(); collection.setCollectionPath(collectionPath); if (args.whitelistFile != null) { List<String> lines = FileUtils.readLines(new File(args.whitelistFile), "utf-8"); this.whitelistDocids = new HashSet(lines); } else { this.whitelistDocids = null; } this.counters = new Counters(); }

Target:
public IndexCollection(IndexCollection.Args args) throws Exception { this.args = args; LOG.info("Collection path: " + args.input); LOG.info("Index path: " + args.index); LOG.info("CollectionClass: " + args.collectionClass); LOG.info("Generator: " + args.generatorClass); LOG.info("Threads: " + args.threads); LOG.info("Keep stopwords? " + args.keepStopwords); LOG.info("Store positions? " + args.storePositions); LOG.info("Store docvectors? " + args.storeDocvectors); LOG.info("Store transformed docs? " + args.storeTransformedDocs); LOG.info("Store raw docs? " + args.storeRawDocs); LOG.info("Optimize (merge segments)? " + args.optimize); LOG.info("Whitelist: " + args.whitelist); this.indexPath = Paths.get(args.index); if (!Files.exists(this.indexPath)) { Files.createDirectories(this.indexPath); } collectionPath = Paths.get(args.input); if (!Files.exists(collectionPath) || !Files.isReadable(collectionPath) || !Files.isDirectory(collectionPath)) { throw new RuntimeException("Document directory " + collectionPath.toString() + " does not exist or is not readable, please check the path"); } this.transformerClass = Class.forName("io.anserini.index.generator." + args.generatorClass); this.collectionClass = Class.forName("io.anserini.collection." + args.collectionClass); collection = (Collection) this.collectionClass.newInstance(); collection.setCollectionPath(collectionPath); if (args.whitelist != null) { List<String> lines = FileUtils.readLines(new File(args.whitelist), "utf-8"); this.whitelistDocids = new HashSet(lines); } else { this.whitelistDocids = null; } this.counters = new Counters(); }