| 40 | } |
| 41 | |
| 42 | std::vector<std::unordered_set<std::string>> LoadMultiVariantSets( |
| 43 | const std::string& path) { |
| 44 | std::ifstream stream(path); |
| 45 | EXPECT_TRUE(stream.is_open()) << path; |
| 46 | |
| 47 | std::vector<std::unordered_set<std::string>> variantSets; |
| 48 | std::string line; |
| 49 | while (std::getline(stream, line)) { |
| 50 | if (!IsDictionaryEntry(line)) { |
| 51 | continue; |
| 52 | } |
| 53 | |
| 54 | const size_t firstTab = line.find('\t'); |
| 55 | if (firstTab == std::string::npos) { |
| 56 | continue; |
| 57 | } |
| 58 | const size_t secondTab = line.find('\t', firstTab + 1); |
| 59 | const std::string variantsText = |
| 60 | line.substr(firstTab + 1, secondTab - firstTab - 1); |
| 61 | std::vector<std::string> variants = SplitValues(variantsText); |
| 62 | if (variants.size() <= 1) { |
| 63 | continue; |
| 64 | } |
| 65 | |
| 66 | variantSets.emplace_back(variants.begin(), variants.end()); |
| 67 | } |
| 68 | return variantSets; |
| 69 | } |
| 70 | |
| 71 | bool IsInSameMultiVariantSet( |
| 72 | const std::vector<std::unordered_set<std::string>>& variantSets, |
no test coverage detected