protected void parseLineInternal(String line) {
List<String> entries = tokenize(line);
int cardinality = Integer.parseInt(entries.get(0));
TIntFloatHashMap values = new TIntFloatHashMap(cardinality, 1);
LabelList labels = null;
for(int i = 1; i < entries.size() - 1; i++) {
if(!labelIndices.get(i)) {
try {
int index = Integer.valueOf(entries.get(i));
if(index > maxdim) {
maxdim = index;
}
float attribute = Float.valueOf(entries.get(i));
values.put(index, attribute);
i++;
}
catch(NumberFormatException e) {
if(labels == null) {
labels = new LabelList(1);
}
labels.add(entries.get(i));
continue;
}
}
else {
if(labels == null) {
labels = new LabelList(1);
}
labels.add(entries.get(i));
}
}
curvec = new SparseFloatVector(values, maxdim);
curlbl = labels;
}