// file: latn_score_1.cc
//

// isip include files
//
#include "lattice_node.h"
#include "lattice_node_constants.h"

// method: get_acscore_cc
//
// arguments:
//  Lattice_node* lnode: (input) the next lattice node
//  
// return: a float_4 with ac score
//
// this method gets the ac score of the specified end node
//
float_4 Lattice_node::get_acscore_cc(Lattice_node* lnode_a) {

  // loop over all the next lattice nodes
  //
  float_4 score = (float_4)0;
  int_4 index = (int_4)0;
  for (Link_node* nd = next_nodes_d->get_head_cc();
       nd != (Link_node*)NULL; nd = nd->get_next_cc()) {
    
    // break if the desired lattice node is found
    //
    if ((Lattice_node*)(nd->get_item_cc()) == lnode_a) {
      score = ac_scores_d[index];
      break;
    }

    // increment count
    //
    index++;
  }
  
  // return score and exit gracefully
  //
  return score;
}
