Write Filter Program Tokenizes Input Inserts Words Binary Tree Strings Elements Try Create Q43895984
C++ Program using visual studio or Cygwin.
Write a filter program that tokenizes its input and inserts the words in a binary tree of strings elements. Try to create your binary tree as a template class and instantiate it with a string. (Note you are to write your own tree class from scratch. Do not use the STL or other libraries, the point here is to review your data structure skills). When all the words in the input file are exhausted you are to print the words on the standard output file (one word per line). (Print the tree using In-order traversal) Consult your data structure books if necessary. Specification of a token: All alphabetic characters in the file should be translated to lower case. Punctuation and white space (blanks, t and n) separate the words. Hyphens in a word (such as alternative-facts or state-of-the-art) are also included as word separators. Apostrophes in the interior of a word are part of the word (e.g. doesn’t, I’ll and must be preserved. However, apostrophes before or after a word should be discarded (e.g. ’tis = tis, chris’ = chris). All other punctuation and special symbols should be discarded (for example”,. &^, #, @,!, =, |, >,<, +, etc.) and viewed as separators. Numbers (on their own or attached to other words) are not part of words and must be discarded. (192 chicken asked “2be or not 2be = be or not be”, “25th =th”, “ab12cd = abcd”) After the text is tokenized, and populated in the binary tree, perform an In-Order traversal and display each word in a separate line. Show transcribed image text Write a filter program that tokenizes its input and inserts the words in a binary tree of strings elements. Try to create your binary tree as a template class and instantiate it with a string. (Note you are to write your own tree class from scratch. Do not use the STL or other libraries, the point here is to review your data structure skills). When all the words in the input file are exhausted you are to print the words on the standard output file (one word per line). (Print the tree using In-order traversal) Consult your data structure books if necessary. Specification of a token: All alphabetic characters in the file should be translated to lower case. Punctuation and white space (blanks, t and n) separate the words. Hyphens in a word (such as alternative-facts or state-of-the-art) are also included as word separators. Apostrophes in the interior of a word are part of the word (e.g. doesn’t, I’ll and must be preserved. However, apostrophes before or after a word should be discarded (e.g. ’tis = tis, chris’ = chris). All other punctuation and special symbols should be discarded (for example”,. &^, #, @,!, =, |, >,
Expert Answer
Answer to Write a filter program that tokenizes its input and inserts the words in a binary tree of strings elements. Try to creat…
OR