📄 lm_05.cc
字号:
// file: $isip/class/asr/LanguageModel/lm_05.cc// version: $Id: lm_05.cc,v 1.6 2002/07/16 03:11:38 wang Exp $//// isip include files//#include "LanguageModel.h"#include <Console.h>// method: load//// arguments:// const Vector<String>& files_a: (input) a vector of input files// const Vector<String>& tags_a: (input) a vector of level tages//// return: a boolean value indicating status//// This method reads levels of language models from a vector of input files// where each file is corresponding to a search level//boolean LanguageModel::load(const Vector<String>& files_a, const Vector<String>& tags_a) { // set num_level_d // for each search level there is one file in the input vector // num_level_d = files_a.length(); search_levels_d.setLength(num_level_d); for(long i=0; i<num_level_d; i++) { String file_name = files_a(i); String level_tag = tags_a(i); // set level index // search_levels_d(i).setLevelIndex(i); // declare a sof file pointer // Sof sof; // open the sof file // if(!sof.open(file_name, File::READ_ONLY)) { return Error::handle(file_name, L"open", Error::TEST, __FILE__, __LINE__); } // read in the user settings for the ISIP graph // starting and terminal symbols // setGraphEndings(sof); // read the data from the file // read(sof, level_tag, search_levels_d(i)); // close the file // sof.close(); } // end: for(long i=0; i<num_files_a; i++) // exit gracefully // return true;}// method: load//// arguments:// const Vector<String>& files_a: (input) a vector of input files// const Vector<String>& tags_a: (input) a vector of level tages// Vector<SearchLevel>& search_levels_a: (output) search levels//// return: a boolean value indicating status//// This method reads levels of language models from a vector of input files// where each file is corresponding to a search level, but store the level// informations into the output search levels//boolean LanguageModel::load(const Vector<String>& files_a, const Vector<String>& tags_a, Vector<SearchLevel>& search_levels_a) { // set num_level_d // for each search level there is one file in the input vector // num_level_d = files_a.length(); // resize search_level_d to fit the needed length // //search_levels_d.setLength(num_level_d, false); for(long i=0; i<num_level_d; i++) { String file_name = files_a(i); String level_tag = tags_a(i); // set level index // search_levels_a(i).setLevelIndex(i); // declare a sof file pointer // Sof sof; // open the sof file // if(!sof.open(file_name, File::READ_ONLY)) { return Error::handle(file_name, L"open", Error::TEST, __FILE__, __LINE__); } // read in the user settings for the ISIP graph // starting and terminal symbols // setGraphEndings(sof); // read the data from the file // read(sof, level_tag, search_levels_a(i)); // close the file // sof.close(); } // end: for(long i=0; i<num_files_a; i++) // exit gracefully // return true;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -