// file: $isip/class/asr/SpeechRecognizer/sr_06.cc
// version: $Id: sr_06.cc
//

// isip include files
//
#include <SpeechRecognizer.h>

// method: setParam
//
// arguments:
//  String param_file_name: (input) parameter file name
//
// set paramter file for recognizer and read initial HMM parameters from it
//
boolean SpeechRecognizer::setParam(String param_file_name) {

  param_file_name_d = param_file_name;

  if (algorithm_d == HMM) {
    
    // set up initial hmm parameters from parameter file
    //
    Sof param_file_sof;
    if (!param_file_sof.open(param_file_name_d)) {
      return Error::handle(name(), L"setParam: opening model file",
			   Error::FILE_NOTFND, __FILE__, __LINE__);

    }

    if (!hmm_d.read(param_file_sof,
		    param_file_sof.first(hmm_d.name()))) {
      return Error::handle(name(), L"setParam: reading HMM parameters",
			   Error::ARG, __FILE__, __LINE__);
    }
    param_file_sof.close();
  }

  return true;  
}







