List<String> targetSegmentList) {
Matrix<Float> forwardMatrix = matrixFactory.createMatrix(
sourceSegmentList.size() + 1, targetSegmentList.size() + 1);
ProgressMeter progress = new ProgressMeter("Forward-Backward Align", forwardMatrix.getSize() * 2);
ProgressManager.getInstance().registerProgressMeter(progress);
MatrixIterator<Float> forwardIterator = forwardMatrix.getIterator();
while(forwardIterator.hasNext()) {
forwardIterator.next();
int x = forwardIterator.getX();
int y = forwardIterator.getY();
float data = createForwardData(x, y, sourceSegmentList,
targetSegmentList, forwardMatrix);
forwardMatrix.set(x, y, data);
progress.completeTask();
}
Matrix<Float> backwardMatrix = matrixFactory.createMatrix(
sourceSegmentList.size() + 1, targetSegmentList.size() + 1);
MatrixIterator<Float> backwardIterator = backwardMatrix.getIterator();
backwardIterator.afterLast();
while(backwardIterator.hasPrevious()) {
backwardIterator.previous();
int x = backwardIterator.getX();
int y = backwardIterator.getY();
float data = createBackwardData(x, y, sourceSegmentList,
targetSegmentList, backwardMatrix);
backwardMatrix.set(x, y, data);
progress.completeTask();
}
List<Alignment> alignmentList = new ArrayList<Alignment>();
float totalScore = forwardMatrix.get(sourceSegmentList.size(),