// file: ngrm_lm_1.cc
//

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

// method: get_score_cc
//
// arguments:
//  int_4 num: (input) size of word history
//  Word** history: (input) pointers for history of current word
//  Word* word: (input) pointer to the current word
//  
// return: a float_4 score represented by the ngram
//
// this method returns the score represented by the ngram
//
float_4 Ngram::get_score_cc(int_4 num_a, Word** history_a, Word* word_a) {

  // define a new word list comprising of all the words
  //
  int_4 size = num_a + 1;
  Word** words = new Word*[size];
  for (int_4 i = 0; i < num_a; i++) {
    words[i] = history_a[i];
  }
  words[num_a] = word_a;
  
  // get ngram score
  //
  float_4 score = get_score_cc(size, words);

  // free memory
  //
  delete [] words;
  
  // exit gracefully
  //
  return score;
}







