// file: ngrl_set_2.cc
//

// isip include files
//
#include "ngram_list.h"
#include "ngram_list_constants.h"

// method: set_node_cc
//
// arguments:
//  int_4 index: (input) the position of the node in the array
//  Ngram_node* node: (input) the ngram node to be placed there
//
// return:  a logical_1 indicating success
//
// this method sets the input ngram node in the array at the specified
// position
//
logical_1 Ngram_list::set_node_cc(int_4 index_a, Ngram_node* node_a) {

  // make sure the index is within bounds
  //
  if ((index_a >= num_d) || (index_a < NGRAM_LIST_DEFAULT_NUM)) {
    error_handler_cc((char_1*)"set_nodes_cc",
		     (char_1*)"input index is out of range for array size");
  }
  
  // set the ngram node at this point
  //
  nodes_d[index_a] = node_a;
        
  // exit gracefully
  //
  return ISIP_TRUE;
}
