| 17 | size_t maxWordLength(const WordCounts& wordCounts); |
| 18 | |
| 19 | int main() |
| 20 | { |
| 21 | std::string text; // The string to count words in |
| 22 | |
| 23 | // Read a string from the keyboard |
| 24 | std::cout << "Enter a string terminated by *:" << std::endl; |
| 25 | getline(std::cin, text, '*'); |
| 26 | |
| 27 | const Words words{ extractWords(text) }; |
| 28 | if (words.empty()) |
| 29 | { |
| 30 | std::cout << "No words in text." << std::endl; |
| 31 | return 0; |
| 32 | } |
| 33 | |
| 34 | WordCounts wordCounts = countWords(words); |
| 35 | showWordCounts(wordCounts); |
| 36 | } |
| 37 | |
| 38 | Words extractWords(std::string_view text, std::string_view separators) |
| 39 | { |
nothing calls this directly
no test coverage detected