eA = e;
}
try
{
Configuration config = (Configuration)Configuration.getDefaultConfiguration().clone();
RPNIBlueFringeLearnerTestComponentOpt l = new RPNIBlueFringeLearnerTestComponentOpt(null,config);
config.setLearnerIdMode(Configuration.IDMode.POSITIVE_NEGATIVE);
l.init(plusStrings, minusStrings);
actualC = l.scoreComputer.paths.getGraph();
}
catch(IllegalArgumentException e)
{
// ignore this - it might be expected.
eC = e;
}
try
{
Configuration config = (Configuration)Configuration.getDefaultConfiguration().clone();
RPNIBlueFringeLearnerTestComponentOpt l = new RPNIBlueFringeLearnerTestComponentOpt(null,config);
config.setLearnerIdMode(Configuration.IDMode.POSITIVE_NEGATIVE);
PTASequenceEngine engine = buildPTA(plusStrings, minusStrings);
checkPTAConsistency(engine, plusStrings, true);if (engine.numberOfLeafNodes()>0) checkPTAConsistency(engine, minusStrings, false);
l.init(engine,0,0);
actualD = l.scoreComputer.paths.getGraph();
}
catch(IllegalArgumentException e)
{
// ignore this - it might be expected.
eD = e;
}
try
{
Configuration config = (Configuration)Configuration.getDefaultConfiguration().clone();
RPNIBlueFringeLearnerTestComponentOpt l = new RPNIBlueFringeLearnerTestComponentOpt(null,config);
config.setLearnerIdMode(Configuration.IDMode.POSITIVE_NEGATIVE);
l.init(buildPTA(plusStrings, buildSet(new String[][] {})),0,0);
for(List<String> seq:minusStrings)
l.scoreComputer.paths.augmentPTA(buildPTA(buildSet(new String[][] {}),buildSet(new String[][] { (String [])seq.toArray()})));
actualE = l.scoreComputer.paths.getGraph();
}
catch(IllegalArgumentException e)
{
// ignore this - it might be expected.
eE = e;
}
if (eA != null)
{
Assert.assertNotNull(eC);
Assert.assertNotNull(eD);
Assert.assertNotNull(eE);
throw eA;
}
Assert.assertNull(eA);
Assert.assertNull(eC);
Assert.assertNull(eD);
Assert.assertNull(eE);
Configuration config = (Configuration)Configuration.getDefaultConfiguration().clone();
config.setAllowedToCloneNonCmpVertex(true);
TestFSMAlgo.checkM(actualA, expectedPTA,config);
TestFSMAlgo.checkM(actualC, expectedPTA,config);
//Visualiser.updateFrame(actualE,TestFSMAlgo.buildGraph(expectedPTA,"expected graph"));Visualiser.waitForKey();
TestFSMAlgo.checkM(actualD,expectedPTA ,config);
TestFSMAlgo.checkM(actualE,expectedPTA ,config);