Package cc.mallet.util.search

Examples of cc.mallet.util.search.AStar


    int f = 0;
    for (int i = 0; i < t.numStates(); i++) {
      if (lattice[latticeLength-1][i] != null && lattice[latticeLength-1][i].delta > Transducer.IMPOSSIBLE_WEIGHT)
        finalNodes[f++] = lattice[latticeLength-1][i];
    }
    AStar search = new AStar(finalNodes, latticeLength * t.numStates());
    List<SequencePairAlignment<Object,ViterbiNode>> outputs = new ArrayList<SequencePairAlignment<Object,ViterbiNode>>(n);
    for (int i = 0; i < n && search.hasNext(); i++) {
      // gsc: removing unnecessary cast
      SearchNode ans = search.next();
      double weight = -ans.getCost();
      ViterbiNode[] seq = new ViterbiNode[latticeLength];
      // Commented out so we get the start state ViterbiNode -akm 12/2007
      //ans = ans.getParent(); // ans now corresponds to the Viterbi node after the first transition
      for (int j = 0; j < latticeLength; j++) {
View Full Code Here

TOP

Related Classes of cc.mallet.util.search.AStar

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.