// file: $isip/class/pr/LanguageModel/lm_05.cc
//

// isip include files
//
#include "LanguageModel.h"

// method: clear
//
// arguments:
//  Integral::CMODE cmode: (input) clear mode
//
// return: a boolean value indicating status
//
// this method clears the model. in RETAIN mode, the virtual model pointer
// is maintained; all other modes reset the virtual model pointer to the
// default value.
//
boolean LanguageModel::clear(Integral::CMODE cmode_a) {

  // clear up memory and reset
  //
  virtual_lm_d->clear(cmode_a);

  // further clear internal data if necessary
  //
  if ((cmode_a == Integral::RESET) || (cmode_a == Integral::FREE) ||
      (cmode_a == Integral::RELEASE)) {
    if (virtual_lm_d != (LanguageModelBase*)&NO_LANGUAGE_MODEL) {
      delete virtual_lm_d;
      virtual_lm_d = (LanguageModelBase*)&NO_LANGUAGE_MODEL;
    }
  }
  return true;
}



