Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

C++ Program Parsing and Tokenizer Using Classes Project

C++ Program Parsing and Tokenizer Using Classes Project

C++ Program Parsing and Tokenizer Using Classes Project

C++ parser and tokenizer using classes
Design and implement a C++ program to process commands (to parse and tokenize) using classes for that purpose. You will use these classes to extract the passages that form the story from a much larger input file.
Details
You will write code to parse out the different passages in a work of interactive fiction. Reading in and interpreting text is often referred to as parsing. The first step in parsing input is to tokenize the input; that is, break it down into smaller chunks, called tokens, which can be analyzed, and the string of tokens can then be interpreted by the parser. For exceptionally complex input, this tokenization process may even be multi-level, with one tokenizer breaking the initial input into coarse tokens that are then fed into another tokenizer to be broken down into smaller tokens.
Objective
Your goal is to write a pair of classes to tokenize the passages in interactive fiction stories. The “main” class, StoryTokenizer, will take in the text of an interactive fiction story (often stored in HTML files), which it will then break up into PassageToken objects, each of which represent one passage in the IF story (similar to a chapter).
Text Tokens
Interactive fiction works are divided into passages, which appear inside the HTMLtag.Eachpassagewillstartwith andwillend with . In addition to starting with
The body of the passage will be here.

Your StoryTokenizer should have two member functions: hasNextPassage and nextPassage. As can be inferred from the name, hasNextPassage returns whether the story contains another passage (i.e., one that has not been read in yet), while nextPassage returns a PassageToken object describing the passage. It should also have a constructor that accepts a string containing the story to tokenize.
PassageTokens should have two member functions, getName and getText, as well as an appropriate constructor. The getName member function should return the name of the passage, specified as by the name attribute of the starting
tag. The name of the example passage above is “start”. The getText member function should return the text of the passage (between the starting tag and the ending tag ).In the example above, this text would contain “The body of the passage will be here.”, with newlines before and after. An invalid PassageToken (e.g., the return result of nextPassage when there are no more passages) should return an empty string for its name and text. The arguments of the constructor (and data members of PassageTokens) are up to you, as a PassageToken will only be constructed by the StoryTokenizer.
Assembling the Code
You have been provided with a main function that will read in a story from input.txt and use your StoryTokenizer and PassageToken classes to break down that story into its constituent passages. Your tokenizer should appropriately ignore any text in the input file that is not part of a passage. You have also been provided with a couple of example input file you can use to test your tokenizer.
Though there is more than one way to implement your tokenizer, you may wish to take advantage of the find, substr, and/or at member functions of the string class when implementing your code. Check the online documentation (www.cplusplus.com) for more information.
Output
You should submit header and source files for your StoryTokenizer and PassageToken classes as a zip archive. You may combine both of them into a single header and single source file, or you may submit two of each. If you do not combine the headers together, you should #include the PassageToken header at the top of your StoryTokenizer header (storytokenizer.h).
The output should be the same as the other example. Opening this file in a web browser will allow you to play through the story.

“Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you A results.”
Attachments
20190601182814storytokenizerdotcpp (1kB)
20190601183929example_storydothtml (102 kB)
20190601183940example_story_simple (2 kB)
20190601184002storytokenizer_output (2 kB)

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: Blackboard Experts only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Blackboard Experts are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Blackboard Experts is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Blackboard Experts, we have put in place a team of experts who answer to all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.