test(new NoopTransducerTrainer(crf), eval, testData);
}
else {
boolean includeInput = includeInputOption.value();
for (int i = 0; i < testData.size(); i++) {
Sequence input = (Sequence)testData.get(i).getData();
Sequence[] outputs = apply(crf, input, nBestOption.value);
int k = outputs.length;
boolean error = false;
for (int a = 0; a < k; a++) {
if (outputs[a].size() != input.size()) {
logger.info("Failed to decode input sequence " + i + ", answer " + a);
error = true;
}
}
if (! error) {
for (int j = 0; j < input.size(); j++) {
StringBuffer buf = new StringBuffer();
for (int a = 0; a < k; a++) {
buf.append(outputs[a].get(j).toString()).append(" ");
}
if (includeInput) {
FeatureVector fv = (FeatureVector)input.get(j);
buf.append(fv.toString(true));
}
System.out.println(buf.toString());
}
System.out.println();