assertEquals (4, ls1.size ());
}
public void testLabelsAtEnd () throws IOException, ClassNotFoundException
{
GenericAcrfData2TokenSequence p = new GenericAcrfData2TokenSequence (2);
p.setLabelsAtEnd (true);
InstanceList training = new InstanceList (p);
training.addThruPipe (new LineGroupIterator (new StringReader (labelsAtEndData), Pattern.compile ("^$"), true));
assertEquals (1, training.size ());
Instance inst1 = training.get (0);
StringTokenization toks = (StringTokenization) inst1.getData ();
LabelsSequence ls1 = (LabelsSequence) inst1.getTarget ();
assertEquals (4, ls1.size ());
assertEquals (3, toks.get(0).getFeatures ().size ());
assertEquals ("LBLB LBLD", ls1.getLabels (0).toString ());
LabelAlphabet globalDict = p.getLabelAlphabet (0);
assertEquals (2, p.numLevels ());
assertEquals (globalDict, ls1.getLabels (0).get (0).getLabelAlphabet ());
}