public static List<Pair<String, TopKStringPatterns>> readFrequentPattern(
FileSystem fs, Configuration conf, Path path) throws IOException {
List<Pair<String, TopKStringPatterns>> ret = new ArrayList<Pair<String, TopKStringPatterns>>();
Text key = new Text();
TopKStringPatterns value = new TopKStringPatterns();
SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, conf);
// key is feature value is count
while (reader.next(key, value)) {
ret.add(new Pair<String, TopKStringPatterns>(key.toString(),
new TopKStringPatterns(value.getPatterns())));
}
return ret;
}