Question: use c++ to complete 1. Concordance Description: Given an arbitrary text document written in English, write a program that will generate a concordance, i.e. an

use c++ to complete  use c++ to complete 1. Concordance Description: Given an arbitrary text
document written in English, write a program that will generate a concordance,
i.e. an alphabetical list of all word occurrences, labeled with word frequencies.
In addition, label each word with the sentence numbers in which each

1. Concordance Description: Given an arbitrary text document written in English, write a program that will generate a concordance, i.e. an alphabetical list of all word occurrences, labeled with word frequencies. In addition, label each word with the sentence numbers in which each occurrence appeared. There are no right or wrong answers - we assess each solution based on the quality of thinking, the tangible progress made, and the time it took to produce. To keep the evaluation fair and efficient, we generally won't answer follow-up questions about the problem. If you aren't sure about something, just make reasonable Issumptions and let us know what questions you would have asked if given the opportunity. Similarly, feel free to share alternative ways of the thinking about or solving the problem if you feel that you are limited in this scenario. Note: The output will NOT be graded by text- matching alone and will be evaluated on the above criteria. Input Format: Locked stub code in the editor reads the following input from stdin and passes it to the function: . The first line contains a single integer, n, denoting the number of lines of text to process. Each line/of the n subsequent lines (where 0 si ni contains a line of text that should be included in the number of lines of text to process. Each line of the n subsequent lines (where 0 sis n) contains a line of text that should be included in the concordance. Output Format: The function should print the concordance - in alphabetical order to stdout in the following format: Each line should contain the word followed by a) the total number of occurrences and b) the sentence numbers in which the word occurs. Sample Input: 2 Wait a minute. Wait a minute, Doc. Are you telling me that you built a time machine out of a DeLorean? Sample Output: a: 04:1,2,3,37 are (1:3) built! (1:3) delorean: 1:3) doc: (1:2) machine: (1:3) me: (1:3) minute: 12:1,2) of: (1:3) out: 1:3) telling (1:3) * * 1 > #include ... 9 10 Complete the 'generateAndPrintConcordance' function below. 11 12 The function accepts STRING_ARRAY inputlines as parameter. 13 */ 14 15 void generateAndPrintConcordance(vector inputlines) { 16 17 18 } 19 int main() 20 { 21 string inputlines_count_temp; 22 getline (cin, inputlines_count_temp); 23 int inputlines_count = stoi(ltrim(rtrim(inputlines_count_temp])); 25 26 vector inputlines (inputlines_count); 27 28 for (int i = 0; i (isspace))) 45 46 Test Results Custom Input Run Code int inputlines_count = stoi(ltrim(rtrim(inputlines_count_temp))); 23 24 25 26 27 28 29 30 vector inputlines (inputlines_count); for (int i = 0; i (isspace))) return s; 50 51 string rtrim(const string &str) { string s(str); 52 53 54 55 56 57 58 s.erase find_if(s.rbegin(), s.rend(), noti(ptr_funsint, int>(isspace))).base(). s.end() 59 return si 60 61 Test Results Custom Input Run Code Run

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!