| 30 | typedef std::chrono::steady_clock BenchmarkClock; |
| 31 | |
| 32 | std::string ReadFile(const std::string& path) { |
| 33 | std::ifstream ifs(path.c_str(), std::ifstream::in | std::ifstream::binary); |
| 34 | if (!ifs.is_open()) { |
| 35 | return std::string(); |
| 36 | } |
| 37 | return std::string((std::istreambuf_iterator<char>(ifs)), |
| 38 | std::istreambuf_iterator<char>()); |
| 39 | } |
| 40 | |
| 41 | std::vector<std::string> LoadDictWords(const std::string& path, size_t limit) { |
| 42 | std::ifstream ifs(path.c_str()); |