int featureIndex = Integer.parseInt(fields[0]);
if (featureIndex == -1) {
String message = "unknown token index. This token is not in the vocabulary! Check bns.pig for errors";
log.error(message);
throw new IncorrectLineFormatException(message);
}
String bnsScoreField = fields[1];
double bnsScore = Double.parseDouble(bnsScoreField);
features[featureIndex] = bnsScore;
log.debug(String.format("Added feature (%d,%f) to vector.",
featureIndex, bnsScore));
} catch (NumberFormatException nfe) {
String message = nfe.toString();
log.warn(message);
throw new IncorrectLineFormatException(message);
}
}