0% found this document useful (0 votes)
44 views2 pages

LAB211Assignment: Title Background Context Program Specifications

The document specifies a Java program assignment to read a text file, normalize the text by applying various formatting rules such as standardizing spacing and capitalization, and write the normalized text to an output file while handling exceptions. The program must normalize the text by applying rules such as having only one space between words, capitalizing the first letter after periods, and removing spaces around quoted phrases. Technical requirements specify using object-oriented programming and only core Java functions and classes.

Uploaded by

Thành Nguyễn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views2 pages

LAB211Assignment: Title Background Context Program Specifications

The document specifies a Java program assignment to read a text file, normalize the text by applying various formatting rules such as standardizing spacing and capitalization, and write the normalized text to an output file while handling exceptions. The program must normalize the text by applying rules such as having only one space between words, capitalizing the first letter after periods, and removing spaces around quoted phrases. Technical requirements specify using object-oriented programming and only core Java functions and classes.

Uploaded by

Thành Nguyễn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Type: Long Assignment

LAB211Assignment Code:
LOC:
614264749.docx
150
Slot(s): 5

Title
Create a Java console program to normalize text.
Background Context
N/A

Program Specifications
The program provides shop owners tools to run their business effectively. The program’s functions as below:

Function details:
The program read text file (input.txt) and normalize text and sentences. After that write normalized document to the
output file (output.txt).

- Only one space between words.


- Only one space after comma (,), dot (.) and colon (:). First character of word after dot is in Uppercase and other
words are in lower case.
- There are no spaces before and after sentence or word phrases in quotes (“”).
- First character of word in first line is in Uppercase.
- There are no blank line between lines
- There are no space between comma or dot and word in front of it.
- Must have dot at the end of text.

The program have to use Exception to handle exception when read or write (file not found, cannot read or write
exception, etc.

Example as below:

Document before normalizing:

as you can see, detecting whether a string is normalized can be quite efficient. A lot of the cost of normalizing in the
“second row” is for the initialization of buffers.The cost of which is amortized when one is processing larger strings.

As it turns out, these buffers are rarely needed, so we may change the implementation at some point to speed up the
common case for small strings even further

Document after normalizing:

“As you can see, detecting whether a string is normalized can be quite efficient. A lot of the cost of normalizing in the
“second row” is for the initialization of buffers, the cost of which is amortized when one is processing larger strings. As it
turns out, these buffers are rarely needed, so we may change the implementation at some point to speed up the
common case for small strings even further.

Technical Requirements
1. Using Object-Oriented programming style.
2. Use only core Java functions and classes.

Guidelines

Slot Task Description


1 - Design Code - Should use BufferReader, StringBuffer…
- Read text file
2 - Normalize content file - Only one space between words.
- Only one space after comma (,), dot (.) and colon (:). First
character of word after dot is in Uppercase and other words
are in lower case

3 - Normalize content file - There are no spaces before and after sentence or word
phrases in quotes (“”).
- First character of word in first line is in Uppercase.

4 - Normalize content file - There are no space between comma or dot and word in front
of it.
- Must have dot at the end of text.
- Write result to output file
5 - Review program

You might also like