Consider the task of translating a plain-text book from Project Gutenberg (http:// gutenberg.org) to HTML. For example,

Question:

Consider the task of translating a plain-text book from Project Gutenberg (http://

gutenberg.org) to HTML. For example, here is the start of the first chapter of Tol stoy’s Anna Karenina:

Chapter 1 Happy families are all alike; every unhappy family is unhappy in its own way.

Everything was in confusion in the Oblonskys' house. The wife had discovered that the husband was carrying on an intrigue with a French girl, who had been a governess in their family, and she had announced to her husband that she could not go on living in the same house with him .….….

The equivalent HTML is:

image text in transcribed

The HTML conversion can be carried out in two steps. First, the plain text is assembled into segments, blocks of text of the same kind (heading, paragraph, and so on).
Then each segment is converted, by sur rounding it with the HTML tags and converting special characters.
Fetching the text from the Internet and breaking it into segments is a challenging task. Provide an inter face and a mock implementation. Combine it with a class that uses the mock implementation to finish the formatting task.

image text in transcribed

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: