Path path = new Path(seqFile.getAbsolutePath());
System.out.println("Input Path: " + path);
FileSystem fs = FileSystem.get(path.toUri(), conf);
SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, conf);
Writable key = (Writable) reader.getKeyClass().newInstance();
ClusterBase value = (ClusterBase) reader.getValueClass().newInstance();
while (reader.next(key, value)) {
Vector center = value.getCenter();
String fmtStr = useJSON ? center.asFormatString() : VectorHelper.vectorToString(center, dictionary);
writer.append("Id: ").append(String.valueOf(value.getId())).append(":");
writer.append("name:").append(center.getName());
if (subString > 0) {
writer.append(":").append(fmtStr.substring(0, Math.min(subString, fmtStr.length())));
}
writer.append('\n');
if (dictionary != null) {
String topTerms = getTopFeatures(center, dictionary, numTopFeatures);
writer.write("\tTop Terms: ");
writer.write(topTerms);
writer.write('\n');
}
List<String> points = clusterIdToPoints.get(String.valueOf(value.getId()));
if (points != null) {
writer.write("\tPoints: ");
for (Iterator<String> iterator = points.iterator(); iterator.hasNext();) {
String point = iterator.next();
writer.append(point);