System.out.println(formatter.html(entry.getValue()));
}
}
public void writeCloudsHTML(Map<Integer,Cloud> cloudMap, String outputPath) {
HTMLFormatter formatter = new HTMLFormatter();
BufferedWriter writer = null;
try {
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputPath), "UTF-8"));
writer.write("<h2>KMeans k=" + cloudMap.size() + "</h2>\n");
for (Map.Entry<Integer, Cloud> entry : cloudMap.entrySet()) {
Integer clusterId = entry.getKey();
formatter.setHtmlTemplateTop("<h3>Cluster ID: " + clusterId + "</h3>");
writer.write(formatter.html(entry.getValue()));
writer.newLine();
}
} catch (UnsupportedEncodingException e) {
LOG.error("UTF-8 is unsupported?", e);
} catch (FileNotFoundException e) {