/**************************************************************************/ /* File: gram_state.h */ /**************************************************************************/ /* Project: Continuous Speech Recognition Search Algorithms */ /* Author: Neeraj Deshmukh, Aravind Ganapathiraju */ /* Class: EE 8993 Spring 1996 Date: March 27, 1996 */ /**************************************************************************/ /*======================================================================== This file declares the grammar state class derived from the generic linked list class that is used in the speech recognizer ========================================================================*/ /*------------------------------------------------------------------------ make sure definitions are only made once ------------------------------------------------------------------------*/ #ifndef __ISIP_GRAM_STATE #define __ISIP_GRAM_STATE /*------------------------------------------------------------------------ system and ISIP include files ------------------------------------------------------------------------*/ #include "linked_list.h" /*------------------------------------------------------------------------ forward declaration of classes ------------------------------------------------------------------------*/ class Linked_List; class Trans_State; class Gram_State; /*======================================================================== Gram_State class definition for the states of the grammar derived from the generic linked list class ========================================================================*/ class Gram_State : public Linked_List { // members // protected: String out_symbol_d; // methods // public: /*-------------------------- constructor and destructor --------------------------*/ Gram_State (String out_name = "", Trans_State *trans_ptr = NULL); ~Gram_State (); /*---------------------- input / output methods ----------------------*/ String get_state_name_cc (); void set_state_name_cc (String out_name); float_8 get_transition_score_cc (String trans_state_name); void add_transition_state_cc (Gram_State *trans_state, float_8 score); Trans_State *get_transition_cc (); /*------------------------- state linked list methods -------------------------*/ Gram_State *get_next_state_cc (); Gram_State *get_prev_state_cc (); Gram_State *add_state_cc (String out_name, Trans_State *trans_ptr = NULL); Gram_State *find_state_cc (String out_name); }; /*======================================================================== Trans_State class definition for the state transitions of the grammar derived from the generic linked list class ========================================================================*/ class Trans_State : public Linked_List { // members // protected: float_8 trans_score_d; // methods // public: /*-------------------------- constructor and destructor --------------------------*/ Trans_State (Gram_State *state_ptr = NULL, float_8 score = 0); ~Trans_State (); /*---------------------- input / output methods ----------------------*/ String get_state_name_cc (); float_8 get_transition_score_cc (String trans_state_name = NULL); /*------------------------------------ state transition linked list methods ------------------------------------*/ Trans_State *get_next_transition_cc (); Trans_State *get_prev_transition_cc (); Trans_State *find_transition_cc (String trans_state_name); Trans_State *add_transition_state_cc (Gram_State *state_ptr, float_8 score); }; #endif