// file: lat_cstr_3.cc
//

// isip include files
//
#include "lattice.h"
#include "lattice_constants.h"

// method: copy constructor
//
// arguments:
//  Lattice& lattice_a: (input) Latitce to copy information from
//
// return: none
//
// this is an overloaded constructor
//
Lattice::Lattice(Lattice& lattice_a) {

  // define local variables
  //
  int_4 str_len = (int_4)0;

  // set node statistics
  //
  num_arcs_d = lattice_a.num_arcs_d;
  num_nodes_d = lattice_a.num_nodes_d;
  
  // set node pointers
  //
  lnode_d = lattice_a.lnode_d;
  start_node_d = lattice_a.start_node_d;
  
  // create memory for the character strings and then copy
  //
  str_len = strlen((char*)lattice_a.lang_model_d) + 1;
  lang_model_d = new char_1[str_len];
  strcpy((char*)lang_model_d,(char*)lattice_a.lang_model_d);
  
  str_len = strlen((char*)lattice_a.utterance_d) + 1;
  utterance_d = new char_1[str_len];
  strcpy((char*)utterance_d,(char*)lattice_a.utterance_d);

  str_len = strlen((char*)lattice_a.model_set_d) + 1;
  model_set_d = new char_1[str_len];
  strcpy((char*)model_set_d,(char*)lattice_a.model_set_d);

  str_len = strlen((char*)lattice_a.name_d) + 1;
  name_d = new char_1[str_len];
  strcpy((char*)name_d,(char*)lattice_a.name_d);

  null_word_d = lattice_a.null_word_d;
  
  // set likelihood scale factors
  //
  lm_scale_d = lattice_a.lm_scale_d;
  word_penalty_d = lattice_a.word_penalty_d;
  
  // exit gracefully
  //
}
