static void read_all_lines(const char* file_name, vector<string>& lines) { ifstream ifs(file_name); if (!ifs) { throw converter_exception(string("cannot open: ") + file_name); } for (string line; getline(ifs, line); ) { lines.push_back(line); } }
static void read_all_lines(const char* file_name, vector<string>& lines) { ifstream ifs(file_name); if (!ifs) { throw JUBATUS_EXCEPTION(converter_exception(string("cannot open: ") + file_name) << jubatus::exception::error_file_name(file_name)); } for (string line; getline(ifs, line); ) { lines.push_back(line); } }
static MeCab::Model* create_mecab_model(const char* arg) { MeCab::Model* t = MeCab::createModel(arg); if (!t) { string msg("cannot make mecab tagger: "); msg += MeCab::getTaggerError(); throw JUBATUS_EXCEPTION(converter_exception(msg)); } else { return t; } }