// indices
Vector vector = sspace.getVector(word);
StringBuilder sb = null;
if (vector instanceof SparseVector) {
if (vector instanceof DoubleVector) {
SparseDoubleVector sdv = (SparseDoubleVector)vector;
int[] nz = sdv.getNonZeroIndices();
sb = new StringBuilder(nz.length * 4);
// special case the first
sb.append(nz[0]).append(",").append(sdv.get(nz[0]));
for (int i = 1; i < nz.length; ++i)
sb.append(",").append(nz[i]).append(",").
append(sdv.getValue(nz[i]).doubleValue());
}
else {
SparseVector sv = (SparseVector)vector;
int[] nz = sv.getNonZeroIndices();
sb = new StringBuilder(nz.length * 4);