// file: latp_compare_0.cc
//

// isip include files
//
#include "lattice_path.h"
#include "lattice_path_constants.h"

// method: compare_cc
//
// arguments:
//  Lattice_path* lpath: (input) the lattice path to compare
//
// return: a Lattice_path* with the better path node
//
// this method compares the input path to the current one and returns
// the better scoring of the two
//
Lattice_path* Lattice_path::compare_cc(Lattice_path* lpath_a) {

  // return value
  //
  Lattice_path* betr_path = (Lattice_path*)NULL;
  
  // check if the two lattice paths can be compared
  //
  if (word_pos_d == lpath_a->word_pos_d) {
    
    // compare scores
    //
    if (score_d > lpath_a->score_d) {
      betr_path = this;
    }
    else {
      betr_path = lpath_a;
    }
  } // end if can be compared
  
  // exit gracefully
  //
  return betr_path;
}
