} else if (search.equals("band")) {
int radius = createInt(commandLine, "radius",
BandMatrixFactory.DEFAULT_BAND_RADIUS);
matrixFactory = new BandMatrixFactory(radius);
} else {
throw new UnknownParameterException("search");
}
if (cls.equals("viterbi")) {
algorithm = new ViterbiAlgorithm(calculator,
categoryMap, matrixFactory);
} else if (cls.equals("fb")) {
algorithm = new ForwardBackwardAlgorithm(calculator,
categoryMap, matrixFactory);
} else {
throw new UnknownParameterException("class");
}
} else if (search.equals("iterative-band")) {
int radius = createInt(commandLine, "radius",
BandMatrixFactory.DEFAULT_BAND_RADIUS);
int margin = createInt(commandLine, "margin",
AdaptiveBandAlgorithm.DEFAULT_MIN_BAND_MARGIN);
float increment = createFloat(commandLine, "increment",
AdaptiveBandAlgorithm.DEFAULT_BAND_INCREMENT_RATIO);
HmmAlignAlgorithmFactory algorithmFactory;
if (cls.equals("viterbi")) {
algorithmFactory = new ViterbiAlgorithmFactory();
} else if (cls.equals("fb")) {
algorithmFactory = new ForwardBackwardAlgorithmFactory();
} else {
throw new UnknownParameterException("class");
}
algorithm = new AdaptiveBandAlgorithm(algorithmFactory,
calculator, radius, increment, margin,
categoryMap);
} else {
throw new UnknownParameterException("search");
}
} else if (cls.equals("one-to-one")) {
boolean one = commandLine.hasOption('o');
algorithm = new OneToOneAlgorithm(one);
} else {
throw new UnknownParameterException("class");
}
return algorithm;
}