Package net.sourceforge.align.progress

Examples of net.sourceforge.align.progress.ProgressMeter


      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(),
View Full Code Here


      List<String> targetSegmentList) {
   
    Matrix<ViterbiData> matrix = matrixFactory.createMatrix(
        sourceSegmentList.size() + 1, targetSegmentList.size() + 1);

    ProgressMeter progress = new ProgressMeter("Viterbi Align", matrix.getSize());
    ProgressManager.getInstance().registerProgressMeter(progress);
   
    MatrixIterator<ViterbiData> iterator = matrix.getIterator();
    while(iterator.hasNext()) {
      iterator.next();
      int x = iterator.getX();
      int y = iterator.getY();
      ViterbiData data = createData(x, y,  sourceSegmentList,
          targetSegmentList, matrix);
      matrix.set(x, y, data);
     
      progress.completeTask();
    }
   
    List<Alignment> alignmentList = backtrace(sourceSegmentList,
        targetSegmentList, matrix);
   
View Full Code Here

TOP

Related Classes of net.sourceforge.align.progress.ProgressMeter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.