| 13 | } |
| 14 | |
| 15 | int main() |
| 16 | { |
| 17 | wrds::Words the_words; |
| 18 | std::string text; // The string to be sorted |
| 19 | const auto separators{" ,.!?\"\n"}; // Word delimiters |
| 20 | |
| 21 | // Read the string to be processed from the keyboard |
| 22 | std::cout << "Enter a string terminated by *:" << std::endl; |
| 23 | getline(std::cin, text, '*'); |
| 24 | |
| 25 | w::extract_words(the_words, text, separators); |
| 26 | if (the_words.empty()) |
| 27 | { |
| 28 | std::cout << "No words in text." << std::endl; |
| 29 | return 0; |
| 30 | } |
| 31 | |
| 32 | wrds::sort(the_words); // Sort the words |
| 33 | w::show_words(the_words); // Output the words |
| 34 | } |
nothing calls this directly
no test coverage detected