| 80 | } |
| 81 | |
| 82 | std::unordered_map<std::string, std::string> LoadPreferredValues( |
| 83 | const std::string& path) { |
| 84 | std::ifstream stream(path); |
| 85 | EXPECT_TRUE(stream.is_open()) << path; |
| 86 | |
| 87 | std::unordered_map<std::string, std::string> preferredValues; |
| 88 | std::string line; |
| 89 | while (std::getline(stream, line)) { |
| 90 | if (!IsDictionaryEntry(line)) { |
| 91 | continue; |
| 92 | } |
| 93 | |
| 94 | const size_t tab = line.find('\t'); |
| 95 | if (tab == std::string::npos) { |
| 96 | ADD_FAILURE() << line; |
| 97 | continue; |
| 98 | } |
| 99 | const std::string key = line.substr(0, tab); |
| 100 | const std::vector<std::string> values = SplitValues(line.substr(tab + 1)); |
| 101 | if (!values.empty()) { |
| 102 | preferredValues[key] = values.front(); |
| 103 | } |
| 104 | } |
| 105 | return preferredValues; |
| 106 | } |
| 107 | |
| 108 | std::unordered_set<std::string> LoadReverseExceptionCharacters( |
| 109 | const std::string& variantsPath, const std::string& variantsRevPath, |
no test coverage detected