📄 searchlevel.h
字号:
// load and store methods // boolean load(Sof& sof, long tag = DEF_TAG); boolean loadLevelTag(Sof& sof, long tag = DEF_TAG); boolean loadSymbols(Sof& sof, long tag = DEF_TAG); boolean loadNonSpeechSymbols(Sof& sof, long tag = DEF_TAG); boolean loadContextLessSymbols(Sof& sof, long tag = DEF_TAG); boolean loadSkipSymbols(Sof& sof, long tag = DEF_TAG); boolean loadDummySymbols(Sof& sof, long tag = DEF_TAG); boolean loadExcludeSymbols(Sof& sof, long tag = DEF_TAG); boolean loadSubGraphs(Sof& sof, long tag = DEF_TAG); boolean loadStatisticalModels(Sof& sof, long tag = DEF_TAG); boolean loadContextMapping(Sof& sof, long tag = DEF_TAG); boolean loadNSymbolModel(Sof& sof, long tag = DEF_TAG); boolean loadNSymbolModel(long tag = DEF_TAG); boolean loadTransitionAccumulators(Sof& sof, long tag = DEF_TAG); boolean loadEmissionAccumulators(Sof& sof, long tag = DEF_TAG); boolean loadOccupancies(); boolean store(Sof& sof, long tag = DEF_TAG); boolean storeLevelTag(Sof& sof, long tag = DEF_TAG); boolean storeSymbols(Sof& sof, long tag = DEF_TAG); boolean storeNonSpeechSymbols(Sof& sof, long tag = DEF_TAG); boolean storeContextLessSymbols(Sof& sof, long tag = DEF_TAG); boolean storeSkipSymbols(Sof& sof, long tag = DEF_TAG); boolean storeDummySymbols(Sof& sof, long tag = DEF_TAG); boolean storeExcludeSymbols(Sof& sof, long tag = DEF_TAG); boolean storeSubGraphs(Sof& sof, long tag = DEF_TAG); boolean storeStatisticalModels(Sof& sof, long tag = DEF_TAG); boolean createStatisticalModels(Sof& sof, long tag = DEF_TAG); boolean storeAccumulators(Sof& sof, long tag = DEF_TAG); boolean storeContextMapping(Sof& sof, long tag = DEF_TAG); boolean storeTransitionAccumulators(Sof& sof, long tag = DEF_TAG); boolean storeEmissionAccumulators(Sof& sof, long tag = DEF_TAG); boolean storeOccupancies(); // method to generate the context map for the search level // boolean generateContextMapping(long left_order, long right_order, Filename& context_list, Vector<SearchLevel>& search_levels, boolean wint_flag_a = false); boolean createCopy(SearchSymbol& central_symbol, ContextMap& context_map, Vector<SearchLevel>& search_levels); // method: getLevelTag // String& getLevelTag() const { return (String&)level_tag_d; } // method: setLevelTag // boolean setLevelTag(String& arg) { return level_tag_d.assign(arg); } // method: getLmScale // float getLmScale() const { return lm_scale_d; } // method: setLmScale // boolean setLmScale(float scale) { return (lm_scale_d = scale); } // method: getTrScale // float getTrScale() const { return tr_scale_d; } // method: setTrScale // boolean setTrScale(float scale) { return (tr_scale_d = scale); } // method: getSymbolPenalty // float getSymbolPenalty() const { return symbol_penalty_d; } // method: setSymbolPenalty // boolean setSymbolPenalty(float penalty) { return (symbol_penalty_d = penalty); } // method: getNumSubGraphs // long getNumSubGraphs() { return sub_graphs_d.length(); } // set the sub graphs // boolean setNumSubGraphs(long num); // method: getSubGraphs // Vector<DiGraph<SearchNode> >& getSubGraphs() { return sub_graphs_d; } // method: getSubGraph // DiGraph<SearchNode>& getSubGraph(long index) { return sub_graphs_d(index); } // method: setSubGraph // boolean setSubGraph(long index, DiGraph<SearchNode>& arg) { if (index < sub_graphs_d.length()) { sub_graphs_d(index) = arg; return true; } return false; } // method: getStatisticalModels // Vector<StatisticalModel>& getStatisticalModels() { return stat_models_d; } // method: setStatisticalModels // boolean setStatisticalModels(long index, StatisticalModel& arg) { if (index < stat_models_d.length()) { stat_models_d(index) = arg; return true; } return false; } // method: getSymbolHashTable // HashTable<SearchSymbol, Long>& getSymbolHashTable() { return symbol_hash_d; } // method: setSymbolHashTable // boolean setSymbolHashTable(HashTable<SearchSymbol, Long>& arg) { symbol_hash_d = arg; return true; } // method: getLevelIndex // long getLevelIndex() const { return level_index_d; } // method: setLevelIndex // boolean setLevelIndex(long num) { level_index_d = num; return true; } // method: getContextMap // Vector<ContextMap>& getContextMap() { return context_map_d; } // method: setContextMap // boolean setContextMap(Vector<ContextMap>& arg) { context_map_d = arg; return true; } // beam pruning methods // boolean setBeam(float beam_threshold); // method: setBeam // boolean setBeam(boolean use_beam_prune = DEF_BEAM_PRUNE, float beam_threshold = DEF_BEAM_THRESHOLD) { use_beam_prune_d = use_beam_prune; return setBeam(beam_threshold); } // method: useBeam // boolean useBeam() const { return use_beam_prune_d; } // method: getBeamThreshold // float getBeamThreshold() const { return beam_threshold_d; } // instance pruning methods // boolean setInstance(boolean use_instance_prune = DEF_INSTANCE_PRUNE, long instance_threshold = DEF_INSTANCE_THRESHOLD); boolean setInstance(long instance_threshold); // method: useInstance // boolean useInstance() const { return use_instance_prune_d; } // method: getInstanceThreshold // long getInstanceThreshold() const { return instance_threshold_d; } // context dependency methods // boolean setContext(long left_context, long right_context); // method: useContext // boolean useContext() const { return use_context_d; } // method: useLexicalTree // boolean useLexicalTree() const { return use_lexical_tree_d; } // method: getLeftContext // long getLeftContext() const { return left_context_d; } // method: getRightContext // long getRightContext() const { return right_context_d; } // n-symbol methods // boolean setNSymbol(long nsymbol_order); boolean setNSymbol(boolean use_nsymbol = DEF_USE_NSYMBOL, long nsymbol_order = DEF_NSYMBOL_ORDER); // method: useNSymbol // boolean useNSymbol() const { return use_nsymbol_d; } // method: getNSymbolOrder // long getNSymbolOrder() const { return nsymbol_order_d; } // method: getNSymbolModel // NGramModel& getNSymbolModel() { return nsymbol_model_d; } // symbol table methods // long getSymbolIndex(const SearchSymbol& input_symbol) const; // method: setSymbolTable // boolean setSymbolTable(Vector<SearchSymbol>& symbol_list) { return symbol_table_d.assign(symbol_list); } // method: getSymbolTable // Vector<SearchSymbol>& getSymbolTable() { return symbol_table_d; } // method: setNonSpeechSymbolTable // boolean setNonSpeechSymbolTable(Vector<SearchSymbol>& symbol_list) { return nonspeech_symbol_table_d.assign(symbol_list); } // method: getNonSpeechSymbolTable // Vector<SearchSymbol>& getNonSpeechSymbolTable() { return nonspeech_symbol_table_d; } // method: setDummySymbolTable // boolean setDummySymbolTable(Vector<SearchSymbol>& symbol_list) { return dummy_symbol_table_d.assign(symbol_list); } // method: getDummySymbolTable // Vector<SearchSymbol>& getDummySymbolTable() { return dummy_symbol_table_d; } // method: setExcludeSymbolTable // boolean setExcludeSymbolTable(Vector<SearchSymbol>& symbol_list) { return exclude_symbol_table_d.assign(symbol_list); } // method: getExcludeSymbolTable // Vector<SearchSymbol>& getExcludeSymbolTable() { return exclude_symbol_table_d; } // method: setContextLessSymbolTable // boolean setContextLessSymbolTable(Vector<SearchSymbol>& symbol_list) { return contextless_symbol_table_d.assign(symbol_list); } // method: getContextLessSymbolTable // Vector<SearchSymbol>& getContextLessSymbolTable() { return contextless_symbol_table_d; } // method: setSkipSymbolTable // boolean setSkipSymbolTable(Vector<SearchSymbol>& symbol_list) { return skip_symbol_table_d.assign(symbol_list); } // method: getSkipSymbolTable // Vector<SearchSymbol>& getSkipSymbolTable() { return skip_symbol_table_d; } // method: setContextHash // boolean setContextHash(HashTable<Context, Ulong> context_hash) { return context_hash_d.assign(context_hash); } // method: getContextHash // HashTable<Context, Ulong>& getContextHash() { return context_hash_d; } // method: getSymbol // boolean getSymbol(SearchSymbol& output_symbol, long index) const { return ( isValidSymbol(index) && output_symbol.assign(symbol_table_d(index)) ); } // method: isValidSymbol // boolean isValidSymbol(long index) const { return ((index >= 0) && (index < symbol_table_d.length())); } // method: isNonSpeechSymbol // boolean isNonSpeechSymbol(long index) const { return (((index >= 0) && (index < symbol_table_d.length())) && nonspeech_symbol_table_d.contains(&symbol_table_d(index))); } // method: isDummySymbol // boolean isDummySymbol(long index) const { return (((index >= 0) && (index < symbol_table_d.length())) && dummy_symbol_table_d.contains(&symbol_table_d(index))); } // method: isExcludeSymbol // boolean isExcludeSymbol(long index) const { return (((index >= 0) && (index < symbol_table_d.length())) && exclude_symbol_table_d.contains(&symbol_table_d(index))); } // method: isContextLessSymbol // boolean isContextLessSymbol(long index) const { return (((index >= 0) && (index < symbol_table_d.length())) && contextless_symbol_table_d.contains(&symbol_table_d(index))); } // method: isSkipSymbol // boolean isSkipSymbol(long index) const { return (((index >= 0) && (index < symbol_table_d.length())) && skip_symbol_table_d.contains(&symbol_table_d(index))); } // method: writeSymbolOccupancy // boolean 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 // boolean connectStatisticalModels(); //--------------------------------------------------------------------------- // // private methods // //---------------------------------------------------------------------------private:};// include the search node class here circumvent the circular dependency//#ifndef ISIP_SEARCH_NODE#include <SearchNode.h>#endif#ifndef ISIP_CONTEXT#include <Context.h>#endif// end of include file//#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -