public class JsonClusterWriter extends AbstractClusterWriter
clusterIdToPoints, measure, writer
Constructor and Description |
---|
JsonClusterWriter(Writer writer,
Map<Integer,List<WeightedPropertyVectorWritable>> clusterIdToPoints,
DistanceMeasure measure,
int numTopFeatures,
String[] dictionary) |
Modifier and Type | Method and Description |
---|---|
List<Object> |
getPoints(Cluster cluster,
String[] dictionary)
Create a List of HashMaps containing Vector point information
|
List<Object> |
getTopFeaturesList(Vector vector,
String[] dictionary,
int numTerms)
Create a List of HashMaps containing top terms information
|
void |
write(ClusterWritable clusterWritable)
Generate HashMap with cluster info and write as a single JSON formatted
line
|
close, getClusterIdToPoints, getTopFeatures, getTopTerms, getWriter, write, write
public JsonClusterWriter(Writer writer, Map<Integer,List<WeightedPropertyVectorWritable>> clusterIdToPoints, DistanceMeasure measure, int numTopFeatures, String[] dictionary)
public void write(ClusterWritable clusterWritable) throws IOException
IOException
public List<Object> getTopFeaturesList(Vector vector, String[] dictionary, int numTerms)
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.