You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
447 B
21 lines
447 B
#include "utils/file_utils.h"
|
|
|
|
namespace ppspeech {
|
|
|
|
bool ReadFileToVector(const std::string& filename,
|
|
std::vector<std::string>* vocabulary) {
|
|
std::ifstream file_in(filename);
|
|
if (!file_in) {
|
|
std::cerr << "please input a valid file" << std::endl;
|
|
return false;
|
|
}
|
|
|
|
std::string line;
|
|
while (std::getline(file_in, line)) {
|
|
vocabulary->emplace_back(line);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
} |