// file: $isip/class/search/SearchLevel/SearchLevel.h // version: $Id: SearchLevel.h 10570 2006-05-13 23:51:06Z may $ // // make sure definitions are only made once // #ifndef ISIP_SEARCH_LEVEL #define ISIP_SEARCH_LEVEL // isip include files: // #ifndef ISIP_SEARCH_SYMBOL #include #endif #ifndef ISIP_STATISTICAL_MODEL #include #endif #ifndef ISIP_MIXTURE_MODEL #include #endif #ifndef ISIP_GAUSSIAN_MODEL #include #endif #ifndef ISIP_NGRAM_MODEL #include #endif #ifndef ISIP_DI_GRAPH #include #endif #ifndef ISIP_NAME_MAP #include #endif #ifndef ISIP_CONTEXT_MAP #include #endif #ifndef ISIP_HASHTABLE #include #endif #ifndef ISIP_FILENAME #include #endif #ifndef ISIP_SDB #include #endif #ifndef ISIP_STRING #include #endif #ifndef ISIP_BOOLEAN #include #endif #ifndef ISIP_FLOAT #include #endif #ifndef ISIP_LONG #include #endif // forward class definitions // class SearchNode; class Context; // SearchLevel: this class represents a particular level in the search // hierarchy for a hierarchical search engine. each level has the following // characteristics: // // a) a beam pruning threshold // b) an instance pruning threshold // c) ability to hold context-dependent models with arbitrary left and right // contexts // d) ability to hold N-symbol context probabilities with arbitrary left // contexts + backoffs // e) maintain or discard old search tokens. for instance, once a higher // level symbol is completed, it may no longer be necessary to maintain // the lower level units that generated that symbol. // class SearchLevel { //--------------------------------------------------------------------------- // // public constants // //--------------------------------------------------------------------------- public: // define the class name // static const String CLASS_NAME; //---------------------------------------- // // other important constants // //---------------------------------------- //---------------------------------------- // // i/o related constants // //---------------------------------------- static const String DEF_PARAM; static const String PARAM_DELIM1; static const String PARAM_DELIM2; static const String PARAM_DELIM3; static const String PARAM_LEVEL_TAG; static const String PARAM_LEVEL_INDEX; static const String PARAM_SYMBOL; static const String PARAM_NONSPEECH_BOUNDARY_SYMBOL; static const String PARAM_NONSPEECH_INTERNAL_SYMBOL; static const String PARAM_DUMMY_SYMBOL; static const String PARAM_EXCLUDE_SYMBOL; static const String PARAM_NSYMBOL_EXCLUDE_SYMBOL; static const String PARAM_SPENALTY_EXCLUDE_SYMBOL; static const String PARAM_CONTEXTLESS_SYMBOL; static const String PARAM_SKIP_SYMBOL; static const String PARAM_MODEL; static const String PARAM_STAT_HASH; static const String PARAM_STAT; static const String PARAM_STAT_OCCUPANCY; static const String PARAM_NON_ADAPT_SYMBOL; static const String PARAM_USE_ACOUSTIC_SCORE; static const String PARAM_ACOUSTIC_SCALE; static const String PARAM_USE_SYMBOL_GRAPH; static const String PARAM_HISTORY_PATHS; static const String PARAM_USE_NSYMBOL; static const String PARAM_NSYMBOL_ORDER; static const String PARAM_LM_SCALE; static const String PARAM_TR_SCALE; static const String PARAM_SYMBOL_PENALTY; static const String PARAM_NSYMBOL_MODEL; static const String PARAM_USE_CONTEXT; static const String PARAM_CONTEXT_MAPPING; static const String PARAM_USE_LEXICAL_TREE; static const String PARAM_LEFT_CONTEXT_LENGTH; static const String PARAM_RIGHT_CONTEXT_LENGTH; static const String PARAM_USE_BEAM; static const String PARAM_BEAM_THRESHOLD; static const String PARAM_USE_INSTANCE; static const String PARAM_INSTANCE_THRESHOLD; static const String PARAM_WRITE_SYMBOL_OCCUPANCY; static const String PARAM_SYMBOL_OCCUPANCY_FILE; //---------------------------------------- // // default values and arguments // //---------------------------------------- // define default value(s) of the class data // static const int32 DEF_TAG = -1; static const int32 DEF_LEVEL_INDEX = 0; // symbol graph rescoring parameters // static const bool8 DEF_USE_ACOUSTIC_SCORE = false; static const float32 DEF_ACOUSTIC_SCALE = 1.0; // symbol graph generation parameters // static const bool8 DEF_USE_SYMBOL_GRAPH = false; static const int32 DEF_HISTORY_PATHS = 10; // beam pruning parameters // static const bool8 DEF_BEAM_PRUNE = false; static const float32 DEF_BEAM_THRESHOLD = 300.0; // instance pruning parameters // static const bool8 DEF_INSTANCE_PRUNE = false; static const int32 DEF_INSTANCE_THRESHOLD = 3000; // context modes parameters // static const bool8 DEF_USE_CONTEXT = false; static const bool8 DEF_USE_LEXICAL_TREE = false; static const int32 DEF_LEFT_CONTEXT = 0; static const int32 DEF_RIGHT_CONTEXT = 0; // n-symbol modes parameters // static const bool8 DEF_RESCORE_MODE = false; static const bool8 DEF_USE_NSYMBOL = false; static const int32 DEF_NSYMBOL_ORDER = 0; static const float32 DEF_SYMBOL_PENALTY = 0.0; static const float32 DEF_LM_SCALE = 1.0; static const float32 DEF_TR_SCALE = 1.0; // symbol occupancy parameters // static const bool8 DEF_WRITE_SYMBOL_OCCUPANCY = false; // num of mixtures // static const int32 DEF_NUM_OF_MIXTURES = 1; //--------------------------------------- // // error codes // //--------------------------------------- static const int32 ERR = (int32)90800; //--------------------------------------------------------------------------- // // protected data // //--------------------------------------------------------------------------- protected: // level number // Long level_index_d; // level tag // String level_tag_d; // num of mixtures // Long num_of_mixtures_d; // type of the statistical model // StatisticalModel::TYPE stat_model_type_d; // symbols at this level, // eg. if this is word level, symbols are all the words // if phone level, symbols are all the phones // Vector symbol_table_d; // non-speech boundary symbols at this level, // symbols that are inserted at transcription ends in the training process // Vector nonspeech_boundary_symbol_table_d; // non-speech internal symbols at this level, // symbols that are inserted between each symbol in the training process // Vector nonspeech_internal_symbol_table_d; // dummy symbols at this level, // symbols that act as mere place holders in the decoding process // Vector dummy_symbol_table_d; // exclude symbols at this level, // symbols that are excluded from the final hypothesis // Vector exclude_symbol_table_d; // nsymbol exclude symbols at this level, // symbols that are excluded from the nsymbol computation // Vector nsymbol_exclude_symbol_table_d; // symbol penalty exclude symbols at this level, // symbols that are excluded from the symbol penalty application // Vector spenalty_exclude_symbol_table_d; // context less symbols at this level, // symbols that are context-independent throughout the decoding process // Vector contextless_symbol_table_d; // skip symbols at this level, // symbols that are context-independent and cannot be a context for // any other symbol // Vector skip_symbol_table_d; // non adapt symbols at this level, // symbols that are will not be adpated during statistical // model adaptation // Vector non_adapt_symbol_table_d; // symbol to statistical model mapping at this level, // hashtable of symbol and its index in the stat_models_d // this is for finding the index of a statistical model (value) // corresponding to a symbol (key) // HashTable symbol_hash_d; // statistical models at this level, // statistical modesl have a unique index that can be cross referenced // via the hashtable of symbol symbol_hash_d // Vector stat_models_d; // subgraph of the symbols at this level, // if this is the word level, the sub_graphs will be the phone network(s), // if this is the phone level, the sub_graphs will be the HMM(s) // Vector > sub_graphs_d; // temporary set of graphs that are read from and written to an Sof file, // these graphs are used to construct the actual subgraph of symbols at // this particular level, this object must be member data accessible by // the write method of this class in order to calculate the correct // sof size for writing to a binary file // Vector< DiGraph > tmp_graphs_d; // variables related to language and acoustic model rescoring at this level // Boolean use_rescore_d; Boolean use_acoustic_score_d; Float acoustic_scale_d; // variables related to evaluation of n-symbol probabilities at this level, // order 1 is equivalent to prob{Symbol(n)} // order 2 is equivalent to prob{Symbol(n) | Symbol(n-1)} // order 3 is equivalent to prob{Symbol(n) | Symbol(n-1), Symbol(n-2)} // likewise for orders 4, 5, 6, ..., N // Boolean use_nsymbol_d; Long nsymbol_order_d; // variables related to symbol graph generation // Boolean use_symbol_graph_d; Long history_paths_d; // member variable that computes the n-symbol probability of a sequence // Filename nsymbol_file_d; NGramModel nsymbol_model_d; // member variables related to the scale and symbol insertion penalty // Float tr_scale_d; Float lm_scale_d; Float symbol_penalty_d; // variables related to context dependency at this level, // member variables related to generation of context-dependent expansion of // models for evaluation // Boolean use_context_d; Long left_context_d; Long right_context_d; // member variable that associates a context with a subgraph index // Vector context_map_d; HashTable context_hash_d; // member variables related to generation of lexical tree expansion of // models for evaluation // Boolean use_lexical_tree_d; // variables related to prunning at this level at this level, // member variables related to beam pruning. if the flag is set to true, // beam pruning will be employed at this level with the given beam threshold // Boolean use_beam_prune_d; Float beam_threshold_d; // member variables related to instance pruning. if the flag is set to // true, instance pruning will be employed at this level with only the // given number of instances maintained. // Boolean use_instance_prune_d; Long instance_threshold_d; // member variable related to symbol occupancies. the symbol // occupancies will be written to the file only when the flag is // true // Filename symbol_occupancy_file_d; Boolean write_symbol_occupancy_d; // define a static debug level // static Integral::DEBUG debug_level_d; // define a static memory manager // static MemoryManager mgr_d; //--------------------------------------------------------------------------- // // required public methods // //--------------------------------------------------------------------------- public: // method: name // static const String& name() { return CLASS_NAME; } // other static methods // static bool8 diagnose(Integral::DEBUG debug_level); // debug methods // bool8 debug(const unichar* message) const; // method: setDebug // static bool8 setDebug(Integral::DEBUG debug_level) { debug_level_d = debug_level; return true; } // destructor/constructor(s) // ~SearchLevel(); SearchLevel(); SearchLevel(const SearchLevel& copy_level); // assign methods // bool8 assign(const SearchLevel& copy_level); // sofSize methods // int32 sofSize() const; // method: read // bool8 read(Sof& sof, int32 tag, const String& cname = CLASS_NAME); // method: write // bool8 write(Sof& sof, int32 tag, const String& cname = CLASS_NAME) const; // method: readData // bool8 readData(Sof& sof, const String& pname = DEF_PARAM, int32 size = SofParser::FULL_OBJECT, bool8 param = true, bool8 nested = false); // method: writeData // bool8 writeData(Sof& sof, const String& pname = DEF_PARAM) const; // equality methods // bool8 eq(const SearchLevel& compare_level) const; // method: new // static void* operator new(size_t size) { return mgr_d.get(); } // method: new[] // static void* operator new[](size_t size) { return mgr_d.getBlock(size); } // method: delete // static void operator delete(void* ptr) { mgr_d.release(ptr); } // method: delete[] // static void operator delete[](void* ptr) { mgr_d.releaseBlock(ptr); } // method: setGrowSize // static bool8 setGrowSize(int32 grow_size) { return mgr_d.setGrow(grow_size); } // clear methods // bool8 clear(Integral::CMODE ctype = Integral::DEF_CMODE); //--------------------------------------------------------------------------- // // class-specific public methods // //--------------------------------------------------------------------------- // other read and write methods // bool8 readLevelTag(Sof& sof, SofParser& parser); bool8 readSymbols(Sof& sof, SofParser& parser); bool8 readNonSpeechSymbols(Sof& sof, SofParser& parser); bool8 readDummySymbols(Sof& sof, SofParser& parser); bool8 readExcludeSymbols(Sof& sof, SofParser& parser); bool8 readNSymbolExcludeSymbols(Sof& sof, SofParser& parser); bool8 readSPenaltyExcludeSymbols(Sof& sof, SofParser& parser); bool8 readContextLessSymbols(Sof& sof, SofParser& parser); bool8 readSkipSymbols(Sof& sof, SofParser& parser); bool8 readNonAdaptSymbols(Sof& sof, SofParser& parser); bool8 readSubGraphs(Sof& sof, SofParser& parser); bool8 readContextMapping(Sof& sof, SofParser& parser); bool8 readConfig(Sof& sof, int32 tag, const String& cname = CLASS_NAME); bool8 write(Sof& sof); bool8 writeLevelTag(Sof& sof) const; bool8 writeSymbols(Sof& sof) const; bool8 writeNonSpeechSymbols(Sof& sof) const; bool8 writeContextLessSymbols(Sof& sof) const; bool8 writeSkipSymbols(Sof& sof) const; bool8 writeDummySymbols(Sof& sof) const; bool8 writeExcludeSymbols(Sof& sof) const; bool8 writeNSymbolExcludeSymbols(Sof& sof) const; bool8 writeSPenaltyExcludeSymbols(Sof& sof) const; bool8 writeNonAdaptSymbols(Sof& sof) const; bool8 writeSubGraphs(Sof& sof) const; bool8 writeStatisticalModels(Sof& sof) const; bool8 writeAccumulators(Sof& sof) const; bool8 writeContextMapping(Sof& sof) const; bool8 writeConfig(Sof& sof, int32 tag, const String& cname = CLASS_NAME) const; // load and store methods // bool8 load(Sof& sof, int32 tag = DEF_TAG); bool8 loadLevelTag(Sof& sof, int32 tag = DEF_TAG); bool8 loadSymbols(Sof& sof, int32 tag = DEF_TAG); bool8 loadNonSpeechSymbols(Sof& sof, int32 tag = DEF_TAG); bool8 loadContextLessSymbols(Sof& sof, int32 tag = DEF_TAG); bool8 loadSkipSymbols(Sof& sof, int32 tag = DEF_TAG); bool8 loadDummySymbols(Sof& sof, int32 tag = DEF_TAG); bool8 loadExcludeSymbols(Sof& sof, int32 tag = DEF_TAG); bool8 loadNSymbolExcludeSymbols(Sof& sof, int32 tag = DEF_TAG); bool8 loadSPenaltyExcludeSymbols(Sof& sof, int32 tag = DEF_TAG); bool8 loadNonAdaptSymbols(Sof& sof_a, int32 tag_a); bool8 loadSubGraphs(Sof& sof, int32 tag = DEF_TAG); bool8 loadStatisticalModels(Sof& sof, int32 tag = DEF_TAG); bool8 loadContextMapping(Sof& sof, int32 tag = DEF_TAG); bool8 loadNSymbolModel(Sof& sof, int32 tag = DEF_TAG); bool8 loadNSymbolModel(int32 tag = DEF_TAG); bool8 loadTransitionAccumulators(Sof& sof, int32 tag = DEF_TAG); bool8 loadEmissionAccumulators(Sof& sof, int32 tag = DEF_TAG); bool8 loadOccupancies(); bool8 store(Sof& sof, int32 tag = DEF_TAG); bool8 storeLevelTag(Sof& sof, int32 tag = DEF_TAG); bool8 storeSymbols(Sof& sof, int32 tag = DEF_TAG); bool8 storeNonSpeechSymbols(Sof& sof, int32 tag = DEF_TAG); bool8 storeContextLessSymbols(Sof& sof, int32 tag = DEF_TAG); bool8 storeSkipSymbols(Sof& sof, int32 tag = DEF_TAG); bool8 storeDummySymbols(Sof& sof, int32 tag = DEF_TAG); bool8 storeExcludeSymbols(Sof& sof, int32 tag = DEF_TAG); bool8 storeNSymbolExcludeSymbols(Sof& sof, int32 tag = DEF_TAG); bool8 storeSPenaltyExcludeSymbols(Sof& sof, int32 tag = DEF_TAG); bool8 storeNonAdaptSymbols(Sof& sof, int32 tag = DEF_TAG); bool8 storeSubGraphs(Sof& sof, int32 tag = DEF_TAG); bool8 storeStatisticalModels(Sof& sof, int32 tag = DEF_TAG); bool8 createStatisticalModels(Sof& sof, int32 tag = DEF_TAG); bool8 storeAccumulators(Sof& sof, int32 tag = DEF_TAG); bool8 storeContextMapping(Sof& sof, int32 tag = DEF_TAG); bool8 storeTransitionAccumulators(Sof& sof, int32 tag = DEF_TAG); bool8 storeEmissionAccumulators(Sof& sof, int32 tag = DEF_TAG); bool8 storeOccupancies(); // method to generate the context map for the search level // bool8 generateContextMapping(int32 left_order, int32 right_order, int32 num_levels, Filename& context_list, SearchLevel& level, bool8 wint_flag = false); bool8 createCopy(int32 num_levels, SearchSymbol& central_symbol, ContextMap& context_map, SearchLevel& level); // method: parseSymbols // bool8 parseSymbols(String& symbols_string, Vector& symbols_vec); // method: convertDigraphs // bool8 convertDigraphs(); // method: convertSubgraphs // Vector< DiGraph > convertSubgraphs() const; // method: readDataNonSpeechInternalSymbol // bool8 readDataNonSpeechInternalSymbol(SofParser& parser, Sof& sof); // method: convertContexts // bool8 convertContexts(); // method: subGraphSize // int32 subGraphSize() const; // method: getLevelTag // String& getLevelTag() const { return (String&)level_tag_d; } // method: setLevelTag // bool8 setLevelTag(String& arg) { return level_tag_d.assign(arg); } // method: getLmScale // float32 getLmScale() const { return lm_scale_d; } // method: setLmScale // bool8 setLmScale(float32 scale) { return (lm_scale_d = scale); } // method: getTrScale // float32 getTrScale() const { return tr_scale_d; } // method: setTrScale // bool8 setTrScale(float32 scale) { return (tr_scale_d = scale); } // method: getSymbolPenalty // float32 getSymbolPenalty() const { return symbol_penalty_d; } // method: setSymbolPenalty // bool8 setSymbolPenalty(float32 penalty) { return (symbol_penalty_d = penalty); } // method: getNumSubGraphs // int32 getNumSubGraphs() { return sub_graphs_d.length(); } // set the sub graphs // bool8 setNumSubGraphs(int32 num); // method: getSubGraphs // Vector >& getSubGraphs() { return sub_graphs_d; } // method: setSubGraphs // bool8 setSubGraphs(Vector >& sub_graphs) { return sub_graphs_d.assign(sub_graphs); } // method: setTempGraphs // bool8 setTempGraphs(Vector >& tmp_graphs) { return tmp_graphs_d.assign(tmp_graphs); } // method: getSubGraph // DiGraph& getSubGraph(int32 index) { return sub_graphs_d(index); } // method: setSubGraph // bool8 setSubGraph(int32 index, DiGraph& arg) { if (index < sub_graphs_d.length()) { sub_graphs_d(index) = arg; return true; } return false; } // method: getStatisticalModels // Vector& getStatisticalModels() { return stat_models_d; } // method: setStatisticalModels // bool8 setStatisticalModels(int32 index, StatisticalModel& arg) { if (index < stat_models_d.length()) { stat_models_d(index) = arg; return true; } return false; } // method: getSymbolHashTable // HashTable& getSymbolHashTable() { return symbol_hash_d; } // method: setSymbolHashTable // bool8 setSymbolHashTable(HashTable& arg) { symbol_hash_d = arg; return true; } // method: getLevelIndex // int32 getLevelIndex() const { return level_index_d; } // method: setLevelIndex // bool8 setLevelIndex(int32 num) { level_index_d = num; return true; } // method: getContextMap // Vector& getContextMap() { return context_map_d; } // method: setContextMap // bool8 setContextMap(Vector& arg) { context_map_d = arg; return true; } // beam pruning methods // bool8 setBeam(float32 beam_threshold); // method: setBeam // bool8 setBeam(bool8 use_beam_prune = DEF_BEAM_PRUNE, float32 beam_threshold = DEF_BEAM_THRESHOLD) { use_beam_prune_d = use_beam_prune; return setBeam(beam_threshold); } // method: useBeam // bool8 useBeam() const { return use_beam_prune_d; } // method: getBeamThreshold // float32 getBeamThreshold() const { return beam_threshold_d; } // method: useSymbolGraph // bool8 useSymbolGraph() const { return use_symbol_graph_d; } // method: getHistoryPaths // int32 getHistoryPaths() const { return history_paths_d; } // instance pruning methods // bool8 setInstance(bool8 use_instance_prune = DEF_INSTANCE_PRUNE, int32 instance_threshold = DEF_INSTANCE_THRESHOLD); bool8 setInstance(int32 instance_threshold); // method: useInstance // bool8 useInstance() const { return use_instance_prune_d; } // method: getInstanceThreshold // int32 getInstanceThreshold() const { return instance_threshold_d; } // context dependency methods // bool8 setContext(int32 left_context, int32 right_context); // method: useContext // bool8 useContext() const { return use_context_d; } // method: useLexicalTree // bool8 useLexicalTree() const { return use_lexical_tree_d; } // method: getLeftContext // int32 getLeftContext() const { return left_context_d; } // method: getRightContext // int32 getRightContext() const { return right_context_d; } // method: useRescore // bool8 useRescore() const { return use_rescore_d; } // method: useAcousticScore // bool8 useAcousticScore() const { return use_acoustic_score_d; } // method: getAcousticScale // float32 getAcousticScale() const { return acoustic_scale_d; } // method: setRescore // bool8 setRescore(bool8 arg) { return (use_rescore_d = arg); } // n-symbol methods // bool8 setNSymbol(int32 nsymbol_order); bool8 setNSymbol(bool8 use_nsymbol = DEF_USE_NSYMBOL, int32 nsymbol_order = DEF_NSYMBOL_ORDER); // method: useNSymbol // bool8 useNSymbol() const { return use_nsymbol_d; } // method: getNSymbolOrder // int32 getNSymbolOrder() const { return nsymbol_order_d; } // method: getNSymbolModel // NGramModel& getNSymbolModel() { return nsymbol_model_d; } // symbol table methods // int32 getSymbolIndex(const SearchSymbol& input_symbol) const; // method: setSymbolTable // bool8 setSymbolTable(Vector& symbol_list) { return symbol_table_d.assign(symbol_list); } // method: getSymbolTable // Vector& getSymbolTable() { return symbol_table_d; } // method: setNonSpeechBoundarySymbolTable // bool8 setNonSpeechBoundarySymbolTable(Vector& symbol_list) { return nonspeech_boundary_symbol_table_d.assign(symbol_list); } // method: getNonSpeechBoundarySymbolTable // Vector& getNonSpeechBoundarySymbolTable() { return nonspeech_boundary_symbol_table_d; } // method: setNonSpeechInternalSymbolTable // bool8 setNonSpeechInternalSymbolTable(Vector& symbol_list) { return nonspeech_internal_symbol_table_d.assign(symbol_list); } // method: getNonSpeechInternalSymbolTable // Vector& getNonSpeechInternalSymbolTable() { return nonspeech_internal_symbol_table_d; } // method: setDummySymbolTable // bool8 setDummySymbolTable(Vector& symbol_list) { return dummy_symbol_table_d.assign(symbol_list); } // method: getDummySymbolTable // Vector& getDummySymbolTable() { return dummy_symbol_table_d; } // method: setExcludeSymbolTable // bool8 setExcludeSymbolTable(Vector& symbol_list) { return exclude_symbol_table_d.assign(symbol_list); } // method: setNSymbolExcludeSymbolTable // bool8 setNSymbolExcludeSymbolTable(Vector& symbol_list) { return nsymbol_exclude_symbol_table_d.assign(symbol_list); } // method: setSPenaltyExcludeSymbolTable // bool8 setSPenaltyExcludeSymbolTable(Vector& symbol_list) { return spenalty_exclude_symbol_table_d.assign(symbol_list); } // method: getExcludeSymbolTable // Vector& getExcludeSymbolTable() { return exclude_symbol_table_d; } // method: getNSymbolExcludeSymbolTable // Vector& getNSymbolExcludeSymbolTable() { return nsymbol_exclude_symbol_table_d; } // method: getSPenaltyExcludeSymbolTable // Vector& getSPenaltyExcludeSymbolTable() { return spenalty_exclude_symbol_table_d; } // method: setContextLessSymbolTable // bool8 setContextLessSymbolTable(Vector& symbol_list) { return contextless_symbol_table_d.assign(symbol_list); } // method: getContextLessSymbolTable // Vector& getContextLessSymbolTable() { return contextless_symbol_table_d; } // method: setSkipSymbolTable // bool8 setSkipSymbolTable(Vector& symbol_list) { return skip_symbol_table_d.assign(symbol_list); } // method: getSkipSymbolTable // Vector& getSkipSymbolTable() { return skip_symbol_table_d; } // method: setNonAdaptSymbolTable // bool8 setNonAdaptSymbolTable(Vector& symbol_list) { return non_adapt_symbol_table_d.assign(symbol_list); } // method: getNonAdaptSymbolTable // Vector& getNonAdaptSymbolTable() { return non_adapt_symbol_table_d; } // method: setContextHash // bool8 setContextHash(HashTable context_hash) { return context_hash_d.assign(context_hash); } // method: getContextHash // HashTable& getContextHash() { return context_hash_d; } // method: getSymbol // bool8 getSymbol(SearchSymbol& output_symbol, int32 index) const { return ( isValidSymbol(index) && output_symbol.assign(symbol_table_d(index)) ); } // method: isValidSymbol // bool8 isValidSymbol(int32 index) const { return ((index >= 0) && (index < symbol_table_d.length())); } // method: isNonSpeechBoundarySymbol // bool8 isNonSpeechBoundarySymbol(int32 index) const { return (((index >= 0) && (index < symbol_table_d.length())) && nonspeech_boundary_symbol_table_d.contains(&symbol_table_d(index))); } // method: isNonSpeechInternalSymbol // bool8 isNonSpeechInternalSymbol(int32 index) const { return (((index >= 0) && (index < symbol_table_d.length())) && nonspeech_internal_symbol_table_d.contains(&symbol_table_d(index))); } // method: isDummySymbol // bool8 isDummySymbol(int32 index) const { return (((index >= 0) && (index < symbol_table_d.length())) && dummy_symbol_table_d.contains(&symbol_table_d(index))); } // method: isExcludeSymbol // bool8 isExcludeSymbol(int32 index) const { return (((index >= 0) && (index < symbol_table_d.length())) && exclude_symbol_table_d.contains(&symbol_table_d(index))); } // method: isNSymbolExcludeSymbol // bool8 isNSymbolExcludeSymbol(int32 index) const { return (((index >= 0) && (index < symbol_table_d.length())) && nsymbol_exclude_symbol_table_d.contains(&symbol_table_d(index))); } // method: isSPenaltyExcludeSymbol // bool8 isSPenaltyExcludeSymbol(int32 index) const { return (((index >= 0) && (index < symbol_table_d.length())) && spenalty_exclude_symbol_table_d.contains(&symbol_table_d(index))); } // method: isContextLessSymbol // bool8 isContextLessSymbol(int32 index) const { return (((index >= 0) && (index < symbol_table_d.length())) && contextless_symbol_table_d.contains(&symbol_table_d(index))); } // method: isSkipSymbol // bool8 isSkipSymbol(int32 index) const { return (((index >= 0) && (index < symbol_table_d.length())) && skip_symbol_table_d.contains(&symbol_table_d(index))); } // method: isNonAdaptSymbol // bool8 isNonAdaptSymbol(int32 index) const { return (((index >= 0) && (index < symbol_table_d.length())) && non_adapt_symbol_table_d.contains(&symbol_table_d(index))); } // method: writeSymbolOccupancy // bool8 writeSymbolOccupancy() const { return write_symbol_occupancy_d; } // method to lookup a graph of a context dependent model // Ulong* getSubGraphIndex(const Context& context); // method to map the statistical models to the search nodes // bool8 connectStatisticalModels(); //--------------------------------------------------------------------------- // // private methods // //--------------------------------------------------------------------------- private: }; // include the search node class here circumvent the circular dependency // #ifndef ISIP_SEARCH_NODE #include #endif #ifndef ISIP_CONTEXT #include #endif // end of include file // #endif