minSupport),
minSupport,
maxHeapSize,
features,
new StringOutputConverter(new SequenceFileOutputCollector<Text, TopKStringPatterns>(writer)),
new ContextStatusUpdater(null));
} finally {
Closeables.close(writer, false);
Closeables.close(inputStream, true);
Closeables.close(inputStreamAgain, true);
}
} else {
FPGrowth<String> fp = new FPGrowth<String>();
inputStream = fs.open(input);
inputStreamAgain = fs.open(input);
try {
fp.generateTopKFrequentPatterns(
new StringRecordIterator(new FileLineIterable(inputStream, encoding, false), pattern),
fp.generateFList(
new StringRecordIterator(new FileLineIterable(inputStreamAgain, encoding, false), pattern),
minSupport),
minSupport,
maxHeapSize,
features,
new StringOutputConverter(new SequenceFileOutputCollector<Text, TopKStringPatterns>(writer)),
new ContextStatusUpdater(null));
} finally {
Closeables.close(writer, false);
Closeables.close(inputStream, true);
Closeables.close(inputStreamAgain, true);
}