// file: ngrm_get_2.cc
//

// isip include files
//
#include "ngram.h"
#include "ngram_constants.h"

// method: get_list_cc
//
// arguments:
//  int_4 index: (input) the index of the ngram list
//  
// return: an Ngram_list* pointer for the ngram list
//
// this method gets the specified ngram list for the ngram LM
//
Ngram_list* Ngram::get_list_cc(int_4 index_a) {

  // make sure the ngram list exists
  //
  if (ngram_lists_d == (Ngram_list**)NULL) {
    error_handler_cc((char_1*)"get_list_cc",
                     (char_1*)"memory in ngram lists not initialized");
  }
  
  // check the validity of the index
  //
  if ((index_a < 0) || (index_a > ngram_order_d - 1)) {
    error_handler_cc((char_1*)"get_list_cc",
                     (char_1*)"invalid list index");
  }
  
  // return the specified ngram list and exit gracefully
  //
  return ngram_lists_d[index_a];
}
