| 4 | import words; |
| 5 | |
| 6 | int main() |
| 7 | { |
| 8 | words::Words the_words; /* Renamed to sidestep name clash with words namespace! */ |
| 9 | std::string text; // The string to be sorted |
| 10 | const auto separators{" ,.!?\"\n"}; // Word delimiters |
| 11 | |
| 12 | // Read the string to be processed from the keyboard |
| 13 | std::cout << "Enter a string terminated by *:" << std::endl; |
| 14 | getline(std::cin, text, '*'); |
| 15 | |
| 16 | words::extract_words(the_words, text, separators); |
| 17 | if (the_words.empty()) |
| 18 | { |
| 19 | std::cout << "No words in text." << std::endl; |
| 20 | return 0; |
| 21 | } |
| 22 | |
| 23 | words::sort(the_words); // Sort the words |
| 24 | words::show_words(the_words); // Output the words |
| 25 | } |
nothing calls this directly
no test coverage detected