/**************************************************************************/ /* File: find_word_seq.cc */ /**************************************************************************/ /* Project: Continuous Speech Recognition Search Algorithms */ /* Author: Neeraj Deshmukh, Aravind Ganapathiraju */ /* Class: EE 8993 Spring 1996 Date: April 24, 1996 */ /**************************************************************************/ /*======================================================================== This routine finds the most probable word sequence from the input data ========================================================================*/ /*------------------------------------------------------------------------ system and ISIP include files ------------------------------------------------------------------------*/ #include "test.h" void find_word_seq_cc ( Score_Hyp *hypothesis , HMM_Model **hmm_model) { //declare local variables // Score_Hyp *best_hyp = new Score_Hyp (); String state_symbol; HMM_State *temp; Score_Hyp *temp_hyp = hypothesis->get_next_hyp_cc (); best_hyp->set_path_score_cc (0.0); int_2 frame_index = temp_hyp->get_timestamp_cc (); // this part is supposed to find all hypotheses which end in stop state // and then back trace // for ( temp_hyp = hypothesis->get_next_hyp_cc (); temp_hyp->get_timestamp_cc () != 0; temp_hyp = temp_hyp->get_next_hyp_cc ()) { temp = (HMM_State *)temp_hyp->get_element_cc (); state_symbol = temp->get_out_symbol_cc (); for (int_2 i = 0; i < NUM_OF_MODELS; i++) { if ((strcmp (state_symbol, (hmm_model[i]->get_stop_state_cc())->get_out_symbol_cc ()) == 0) && (temp_hyp->get_timestamp_cc () == frame_index)) { temp_hyp->word_backtrace_cc (hmm_model, NUM_OF_MODELS); fprintf (stdout, "%f\n",temp_hyp->get_path_score_cc ()); if (temp_hyp->get_path_score_cc () > best_hyp->get_path_score_cc ()) best_hyp = temp_hyp; } } } }