| 64 | } |
| 65 | |
| 66 | std::vector<Entry> LoadEntries(const std::string& path) { |
| 67 | std::ifstream stream(path); |
| 68 | EXPECT_TRUE(stream.is_open()) << path; |
| 69 | |
| 70 | std::vector<Entry> entries; |
| 71 | std::string line; |
| 72 | size_t lineNumber = 0; |
| 73 | while (std::getline(stream, line)) { |
| 74 | ++lineNumber; |
| 75 | if (!IsDictionaryEntry(line)) { |
| 76 | continue; |
| 77 | } |
| 78 | |
| 79 | const size_t tab = line.find('\t'); |
| 80 | if (tab == std::string::npos) { |
| 81 | ADD_FAILURE() << path << ":" << lineNumber |
| 82 | << " is missing a tab separator."; |
| 83 | continue; |
| 84 | } |
| 85 | entries.push_back(Entry{lineNumber, line.substr(0, tab), |
| 86 | SplitValues(line.substr(tab + 1))}); |
| 87 | } |
| 88 | return entries; |
| 89 | } |
| 90 | |
| 91 | std::unordered_map<std::string, std::unordered_set<std::string>> |
| 92 | LoadCharacterCandidates(const std::string& path) { |
no test coverage detected