// file: tr_wrd_cstr_4.cc
//
 
// isip include files
//
#include "train_word.h"
#include "train_word_constants.h"
 
// method: constructor
//
// arguments:
//  Train_Word& word : (input) the word to be copied
//
// return: none
//
// this is the copy constructor
//
Train_Word:: Train_Word(Train_Word& word_a) {

  // set the word index
  //
  index_d = word_a.index_d;
  
  // set the word name
  //
  name_d = new char_1[strlen((char*)word_a.name_d) + (int_4)1];
  strcpy((char*)name_d, (char*)word_a.name_d);
  
  // assign the number of pronunciations
  //
  num_prons_d = word_a.num_prons_d;
  
  // copy the pronunciations
  //
  phone_list_d = new int_4*[num_prons_d];
  num_phones_d = new int_4[num_prons_d];
  for (int_4 i = 0; i < num_prons_d; i++) {
    num_phones_d[i] = word_a.num_phones_d[i];
    phone_list_d[i] = new int_4[num_phones_d[i]];
    memcpy(phone_list_d[i], word_a.phone_list_d[i],
	   num_phones_d[i] * sizeof(int_4));
  }

  // copy the status flag
  //
  active_d = word_a.active_d;
  
  // exit gracefully
  //
}
