// file: hist_word_3.cc
//

// isip include files
//
#include "history.h"
#include "history_constants.h"

// method: get_word_cc
//
// arguments:
//  int_4 index: the word in the history at a specified position
//
// return: a void pointer to a history Word or a lattice/unigram node
//
// this method gets one of the words represented by this history
//
void_p History::get_histwords_cc(int_4 index_a) {

  // make sure the item exist
  //
  if (index_a > hist_len_d - 1) {
    error_handler_cc((char_1*)"get_histwords_cc", (char_1*)"invalid index");
    return (void_p)NULL;
  }

  if (histwords_d == (void_p*)NULL) {
    return (void_p)NULL;
  }
  
  // get the word history and exit gracefully
  //
  return histwords_d[index_a];
}
