| 181 | }; |
| 182 | |
| 183 | void LoadBaseDict(const std::string& path, |
| 184 | std::map<std::string, std::vector<std::string> >& entries) { |
| 185 | std::ifstream ifs(path.c_str()); |
| 186 | if (!ifs.is_open()) { |
| 187 | throw std::runtime_error("failed to open base dict: " + path); |
| 188 | } |
| 189 | |
| 190 | std::string line; |
| 191 | size_t line_number = 0; |
| 192 | while (std::getline(ifs, line)) { |
| 193 | ++line_number; |
| 194 | if (IsCommentOrEmpty(line)) { |
| 195 | continue; |
| 196 | } |
| 197 | const std::vector<std::string> tokens = SplitWhitespace(line); |
| 198 | entries[tokens[0]] = ParseBaseDictValues(tokens, line_number); |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | void LoadUserDict(const std::string& path, |
| 203 | std::map<std::string, std::vector<std::string> >& entries) { |
no test coverage detected