quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_search.a #include <SearchLevel.h> SearchLevel(); SearchLevel(const SearchLevel& copy_slev); boolean loadSymbols(Sof& sof, long tag = DEF_TAG); boolean loadSubGraphs(Sof& sof, long tag = DEF_TAG); boolean setLevelIndex(long num); boolean setNumSubGraphs(long num); DiGraph<SearchNode>& getSubGraph(long index); boolean setBeam(boolean use_beam_prune = DEF_BEAM_PRUNE, float beam_threshold = DEF_BEAM_THRESHOLD) boolean useBeam() const; boolean setSymbolTable(Vector<SearchSymbol>& symbol_list); long getSymbolIndex(const SearchSymbol& input_symbol) const; boolean getSymbol(SearchSymbol& output_symbol, long index) const; boolean isValidSymbol(long index) const;
description:SearchLevel search_level; // configure SearchLevel // Sof model_sof; model_sof.open(L"model.sof"); long num_levels = 3; search_engine.setNumLevels(num_levels); // read models // for (long curr_level = 0; curr_level < num_levels; curr_level++) { SearchLevel& level = search_engine.getSearchLevel(curr_level); level.load(model_sof); }
static const String CLASS_NAME;
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_SYMBOL;
static const String PARAM_NONSPEECH_SYMBOL;
static const String PARAM_DUMMY_SYMBOL;
static const String PARAM_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_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;
static const String PARAM_NON_ADAPT_SYMBOL;
static const long DEF_TAG = -1;
static const long DEF_LEVEL_INDEX = 0;
static const boolean DEF_BEAM_PRUNE = false;
static const float DEF_BEAM_THRESHOLD = 300.0;
static const boolean DEF_INSTANCE_PRUNE = false;
static const long DEF_INSTANCE_THRESHOLD = 3000;
static const boolean DEF_USE_CONTEXT = false;
static const boolean DEF_USE_LEXICAL_TREE = false;
static const long DEF_LEFT_CONTEXT = 0;
static const long DEF_RIGHT_CONTEXT = 0;
static const boolean DEF_USE_NSYMBOL = false;
static const long DEF_NSYMBOL_ORDER = 1;
static const float DEF_SYMBOL_PENALTY = 0.0;
static const float DEF_LM_SCALE = 1.0;
static const float DEF_TR_SCALE = 1.0;
static const boolean DEF_WRITE_SYMBOL_OCCUPANCY = false;
static const long ERR = 90800;
Long level_index_d;
String level_tag_d;
Vector<SearchSymbol> symbol_table_d;
Vector<SearchSymbol> nonspeech_symbol_table_d;
Vector<SearchSymbol> dummy_symbol_table_d;
Vector<SearchSymbol> exclude_symbol_table_d;
Vector<SearchSymbol> contextless_symbol_table_d;
Vector<SearchSymbol> skip_symbol_table_d;
Vector<SearchSymbol> non_adapt_symbol_table_d;
HashTable<SearchSymbol, Long> symbol_hash_d;
Vector<StatisticalModel> stat_models_d;
Vector<DiGraph<SearchNode> > sub_graphs_d;
Boolean use_nsymbol_d;
Long nsymbol_order_d;
Filename nsymbol_file_d;
NGramModel nsymbol_model_d;
Float tr_scale_d;
Float lm_scale_d;
Float symbol_penalty_d;
Boolean use_context_d;
Long left_context_d;
Long right_context_d;
Vector<ContextMap> context_map_d;
HashTable<Context, Ulong> context_hash_d;
Boolean use_lexical_tree_d;
Boolean use_beam_prune_d;
Float beam_threshold_d;
Boolean use_instance_prune_d;
Long instance_threshold_d;
Filename symbol_occupancy_file_d;
Boolean write_symbol_occupancy_d;
static Integral::DEBUG debug_level_d;
static MemoryManager mgr_d;
static const String& name();
static boolean diagnose(Integral::DEBUG debug_level);
boolean debug(const unichar* message) const;
static boolean setDebug(Integral::DEBUG debug_level);
~SearchLevel();
SearchLevel();
SearchLevel(const SearchLevel& copy_level);
boolean assign(const SearchLevel& copy_level);
not present.
long sofSize() const;
boolean read(Sof& sof, long tag, const String& cname = CLASS_NAME);
boolean write(Sof& sof, long tag, const String& cname = CLASS_NAME) const;
boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;
boolean eq(const SearchLevel& compare_level) const;
static void* operator new(size_t size);
static void* operator new[](size_t size);
static void operator delete(void* ptr);
static void operator delete[](void* ptr);
static boolean setGrowSize(long grow_size);
boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);
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 loadAccumulators(Sof& sof, long tag = DEF_TAG);
boolean loadContextMapping(Sof& sof, long tag = DEF_TAG);
boolean loadNSymbolModel(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 storeNonAdaptSymbols(Sof& sof, long tag = DEF_TAG);
boolean storeSubGraphs(Sof& sof, long tag = DEF_TAG);
boolean storeStatisticalModels(Sof& sof, long tag = DEF_TAG);
boolean storeAccumulators(Sof& sof, long tag = DEF_TAG);
boolean storeContextMapping(Sof& sof, long tag = DEF_TAG);
boolean storeOccupancies();
String& getLevelTag() const;
boolean setLevelTag(String& tag);
float getLmScale() const;
boolean setLmScale(float scale);
float getTrScale() const;
boolean setTrScale(float scale);
float getSymbolPenalty() const;
boolean setSymbolPenalty(float penalty);
long getNumSubGraphs();
boolean setNumSubGraphs(long num);
Vector<DiGraph<SearchNode> >& getSubGraphs();
boolean setSubGraphs(Vector<DiGraph<SearchNode> >& sub_graphs);
DiGraph<SearchNode>& getSubGraph(long index);
boolean setSubGraph(long index, DiGraph<SearchNode>& arg);
boolean convertDigraphs(Vector< DiGraph<Ulong> > digraphs);
Vector< DiGraph<Ulong> > convertSubgraphs();
HashTable<SearchSymbol, Long>& getSymbolHashTable();
boolean setSymbolHashTable(HashTable<SearchSymbol, Long>& arg);
long getSymbolIndex(const SearchSymbol& input_symbol) const;
long getLevelIndex() const;
boolean setLevelIndex(long num);
boolean setBeam(float beam_threshold);
boolean setBeam(boolean use_beam_prune = DEF_BEAM_PRUNE, float beam_threshold = DEF_BEAM_THRESHOLD);
boolean useBeam() const;
float getBeamThreshold() const;
boolean setInstance(boolean use_instance_prune = DEF_INSTANCE_PRUNE, long instance_threshold = DEF_INSTANCE_THRESHOLD);
boolean setInstance(long instance_threshold);
boolean useInstance() const;
long getInstanceThreshold() const;
boolean generateContextMapping(long left_order, long right_order, Filename& context_list, Vector<SearchLevel>& search_levels);
boolean createCopy(SearchSymbol& central_symbol, ContextMap& context_map, Vector<SearchLevel>& search_levels);
boolean parseSymbols(String& symbols_string, Vector<SearchSymbol>& symbols_vec);
Vector<ContextMap>& getContextMap();
boolean setContextMap(Vector<ContextMap>& arg);
boolean setContext(long left_context, long right_context);
boolean useContext() const;
long getLeftContext() const;
long getRightContext() const;
boolean useLexicalTree() const;
boolean setNSymbol(boolean use_nsymbol = DEF_USE_NSYMBOL, long nsymbol_order = DEF_NSYMBOL_ORDER);
boolean setNSymbol(long nsymbol_order);
boolean useNSymbol() const;
long getNSymbolOrder() const;
NGramModel& getNSymbolModel();
boolean setSymbolTable(Vector<SearchSymbol>& symbol_list);
Vector<SearchSymbol>& getSymbolTable();
boolean getSymbol(SearchSymbol& output_symbol, long index) const;
boolean isValidSymbol(long index) const;
boolean setNonSpeechSymbolTable(Vector<SearchSymbol>& symbol_list);
Vector<SearchSymbol>& getNonSpeechSymbolTable();
boolean isNonSpeechSymbol(long index) const;
boolean setDummySymbolTable(Vector<SearchSymbol>& symbol_list);
Vector<SearchSymbol>& getDummySymbolTable();
boolean isDummySymbol(long index) const;
boolean setExcludeSymbolTable(Vector<SearchSymbol>& symbol_list);
Vector<SearchSymbol>& getExcludeSymbolTable();
boolean isExcludeSymbol(long index) const;
boolean setContextLessSymbolTable(Vector<SearchSymbol>& symbol_list);
Vector<SearchSymbol>& getContextLessSymbolTable();
boolean isContextLessSymbol(long index) const;
boolean setSkipSymbolTable(Vector<SearchSymbol>& symbol_list);
Vector<SearchSymbol>& getSkipSymbolTable();
boolean isSkipSymbol(long index) const;
Vector<StatisticalModel>& getStatisticalModels();
boolean setStatisticalModels(long index, StatisticalModel& arg);
boolean connectStatisticalModels();
boolean writeSymbolOccupancy() const;
Ulong* getSubGraphIndex(const Context& context);