Computer Science Help The code doesnt need to render just ye

Computer Science Help

The code doesn\'t need to render just yet, I basically just want to help taking the first steps, and I need someone to come up with the functions I\'m going to need for this project. The exact requirements are below followed by the project information.

Requirements:

You may not be able, yet, to take this all the way down to the level where all the functions or pseudocode statements can be obviously rendered into code, but you should strive to reach a level of detail that convinces the graders that you

understand the problem

have described all the major functional behaviors required for this problem (i.e., each kind of input that must be treated differently and each distinct kind of output that you must produce

have identified the major collections of data that will be required (but have not necessarily chosen the data structure for them)

have identified the “hard parts” that you might not yet know how to solve

Each distinct function in your design should be accompanied by a brief paragraph of comments indicating what it does, what its inputs are, and what its outputs will be.

Project Description:

For more than 30 years, Project Gutenberg has collected the texts of public-domain books and made them available in electronic form.

Although some titles are available in html or other richer formats, the project started by collecting books as simple ASCII text files. This project is aimed at providing these files in a more web-friendly format.

There are two components to converting a text file into the desired “paged” format: generating html versions of the pages and preparing an index of the pages.

1 Splitting the Book into Pages

Input to the system will be a book in ASCII .txt format, such as this one. The name of the file containing this book will be supplied as a command line parameter (the only one required by this program.)

The first step in preparing this for the web will be to split this text into web pages, each page but the last containingMAX_LINES_PER_PAGE lines.

The generated web pages will be written to files named “page*NNNN*.html”, where NNNN is a 4 digit number starting at 0001, then 0002, and so on.

Each generated page will consist of an html “wrapper” around the selected lines of text. The wrapper includes the book title (extracted from the Gutenberg text file) and links to the previous page, the next page, and the index page. For example, page 0024 of a book would look like:

The first page will not have the “Prev” link. The final page will not have the “Next” link. The book title can be extracted from the earliest line in the text file that begins with “Title:”.

2 Generating an Index

The final page generated by the program will be stored in “indexPage.html”. This page will look like:

The main portion of the page has a section for each letter from A..Z. Each section has an <h2> header and a <ul>...</ul> list. Inside that list will be one <li>...</li> entry for each index term beginning with the corresponding letter. Each such entry will contain the index term followed by a list of <a...</a> links to pages where that term occurs.

Details:

The index terms will be listed in alphabetical order.

An index term is a word occurring in the book. It consists of consecutive alphabetic characters an must either occur at the beginning of a line or must be preceded by a blank.

Words of 3 letters or less will not be used as index terms.

All index terms will be converted to lower case before being inserted into the index. Words in the text that differ only in the upper/lower case of their letters will be considered to be instances of the same index term.

For an index term to be useful, it must direct one to a limited portion of the book. Consequently, any word that occurs on more than PAGE_THRESHOLD percentage of the total pages will not be treated as an index term.

The constants MAX_LINES_PER_PAGE and PAGE_THRESHOLD will be declared in a header file indexConstants.h

Solution

This example, however trivial, shows how threads behave differently, based on theircreation options. It also shows what happens on the exit of a thread, again based onhow it was created. If you understand this example and how it flows, you should havea good understanding of how to usethr_create()andthr_join()in your ownprograms. Hopefully you can also see how easy it is to create and join threads.The source tomulti_thr.c:#define _REENTRANT#include <stdio.h>#include <thread.h>/* Function prototypes for thread routines */void *sub_a(void *);void *sub_b(void *);void *sub_c(void *);void *sub_d(void *);void *sub_e(void *);void *sub_f(void *)

Computer Science Help The code doesn\'t need to render just yet, I basically just want to help taking the first steps, and I need someone to come up with the fu
Computer Science Help The code doesn\'t need to render just yet, I basically just want to help taking the first steps, and I need someone to come up with the fu

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site