// file: tr_lxn_cstr_4.cc
//

// isip include files
//
#include "train_lex_node.h"
#include "train_lex_node_constants.h"

// method: constructor
//
// arguments:
//  Train_Lex_node& node : (input) the lexical node to copy
//
// return: none
//
// this is a copy constructor
//
Train_Lex_node::Train_Lex_node(Train_Lex_node& node_a) {

  // set the phone-related data
  //
  phone_d = node_a.phone_d;
  phone_index_d = node_a.phone_index_d;
  child_d = (Train_Link_list*)NULL;
  if (node_a.child_d != (Train_Link_list*)NULL) {
    child_d = new Train_Link_list(*node_a.child_d);
  }
  
  // set the word data
  //
  word_list_d = (Train_Link_list*)NULL;
  if (node_a.word_list_d != (Train_Link_list*)NULL) {
    word_list_d = new Train_Link_list(*node_a.word_list_d);
  }
  
  num_words_d = node_a.num_words_d;

  score_list_d = (float_8*)NULL;
  if (node_a.score_list_d != (float_8*)NULL) {
    score_list_d = new float_8[num_words_d];
    memcpy(score_list_d, node_a.score_list_d, num_words_d * sizeof(float_8));
  }

  // set the max LM score
  //
  max_lm_score_d = node_a.max_lm_score_d;
  
  // initialize the parent lexical tree
  //
  tree_d = node_a.tree_d;
  
  // initialize the status flag
  //
  status_d = node_a.status_d;
  
  // exit gracefully
  //
}
