| 82 | |
| 83 | |
| 84 | int main() |
| 85 | { |
| 86 | std::string text; // The string to count words in |
| 87 | |
| 88 | // Read a string from the keyboard |
| 89 | std::cout << "Enter a string terminated by *:" << std::endl; |
| 90 | getline(std::cin, text, '*'); |
| 91 | |
| 92 | const Words words{ extractWords(text) }; |
| 93 | if (words.empty()) |
| 94 | { |
| 95 | std::cout << "No words in text." << std::endl; |
| 96 | return 0; |
| 97 | } |
| 98 | |
| 99 | const WordCounts wordCounts{ countWords(words) }; |
| 100 | showWordCounts(wordCounts); |
| 101 | } |
| 102 | |
| 103 | Words extractWords(std::string_view text, std::string_view separators) |
| 104 | { |
nothing calls this directly
no test coverage detected