/**************************************************************************/ /* File: score_hyp.h */ /**************************************************************************/ /* Project: Continuous Speech Recognition Search Algorithms */ /* Author: Neeraj Deshmukh, Aravind Ganapathiraju */ /* Class: EE 8993 Spring 1996 Date: March 12, 1996 */ /**************************************************************************/ /*======================================================================== This file declares the hypothesis score class that models the various hypotheses for the EE 8993 speech recognizer ========================================================================*/ /*------------------------------------------------------------------------ make sure definitions are only made once ------------------------------------------------------------------------*/ #ifndef __ISIP_SCORE_HYP #define __ISIP_SCORE_HYP /*------------------------------------------------------------------------ system and ISIP include files ------------------------------------------------------------------------*/ #include "hmm_model.h" /*------------------------------------------------------------------------ forward declaration of classes ------------------------------------------------------------------------*/ class HMM_Model; class HMM_State; class HMM_Matrix; class Linked_List; /*------------------------------------------------------------------------ forward declaration of constants ------------------------------------------------------------------------*/ #define HYP_DEAD_TIME -2 /*======================================================================== Score_Hyp class definition for the hypothesis structure ========================================================================*/ class Score_Hyp : public Linked_List{ // members // protected: /*---------------------------------------- elements of path score and frame of data ----------------------------------------*/ float_4 total_path_score_d; int_2 frame_index_d; int_2 word_index_d; /*------------------------- backpointer for best path -------------------------*/ Score_Hyp *hyp_back_ptr_d; // methods // public: /*--------------------------- constructors and destructor ---------------------------*/ // default constructor // Score_Hyp ( HMM_State *curr_state_l = NULL,int_2 fr_ind_l = 0); // copy constructor // Score_hyp (const Score_Hyp &hyp_score_l); // destructor // ~Score_Hyp (); /*---------------------- input / output methods ----------------------*/ void set_path_score_cc (float_4 new_score_l); void update_path_score_l (float_4 incr_score_l); float_4 get_path_score_cc () const; /*------------------------- frame / timestamp/ word index methods -------------------------*/ BOOL check_timestamp_cc (int_2 fr_ind_l); void set_timestamp_cc (int_2 fr_ind_l); void increment_timestamp_cc (); int_2 get_timestamp_cc () const; void set_word_index_cc (int_2 word_index_l); int_2 get_word_index_cc (); /*------------------------- state and backpointer etc -------------------------*/ void set_back_ptr_cc (Score_Hyp *back_ptr_l); Score_Hyp *get_back_ptr_cc (); /*------------------------- linked list methods -------------------------*/ Score_Hyp *add_score_hyp_cc (HMM_State *curr_state_l, Score_Hyp *back_ptr_l, float_4 score_l, int_2 frame_index_l, int_2 word_index_l); void remove_score_hyp_cc (); Score_Hyp *find_score_hyp_cc (HMM_State *curr_state_l, int_2 time_index_l); Score_Hyp *get_next_hyp_cc(); Score_Hyp *get_prev_hyp_cc(); /*--------------------------- back tracing the hypothesis ---------------------------*/ void hyp_backtrace_cc (); void word_backtrace_cc (HMM_Model **model_l, int_2 num_of_models_l); }; #endif