// file: ngrm_sort_0.cc
//

// system include files
//
#include <string.h>
#include <ctype.h>

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

// method: ngnode_compare_cc
//
// arguments:
//  Ngram_node* first: (input) a Ngram_node to compare
//  Ngram_node* second: (input) a second Ngram_node to compare
//
// return: an integer specifying the sort order based on the word id
//         if the word id of first is greater than the word id of
//         second then a positive number is returned
//         if the word id of second is greater than the word id of first
//         then a negative number is returned
//         if the word ids are equal then a zero is returned
//
// this method compares the two inputs for sort order
//
int Ngram::ngnode_compare_cc(Ngram_node** first_a, Ngram_node** second_a) {

  if ((int_4)((*first_a)->get_word_cc()) >
      (int_4)((*second_a)->get_word_cc())) {
    return 1;
  }
  if ((int_4)((*first_a)->get_word_cc()) <
      (int_4)((*second_a)->get_word_cc())) {
    return -1;
  }
  return 0;
}
