int label = doc.getLabel();
// get a vector from the document
// need a metric (e.g. relative frequency / binary)
// and a lexicon
// the vector is represented as a string directly
Vector vector = null;
if (attributeMapping == null)
vector = doc.getFeatureVector(lexicon);
else
vector = doc.getFeatureVector(lexicon, attributeMapping);
StringBuffer buffer = new StringBuffer("{");
buffer.append("0 ").append(lexicon.getLabel(label));
// {1 X, 3 Y, 4 "class A"}
// index space value
int[] indices = vector.getIndices();
double[] values = vector.getValues();
for (int i = 0; i < indices.length; i++) {
if (buffer.length() > 1)
buffer.append(", ");
if (indices[i] > attributeNum)
continue;