Write a program that will read a message from another text file and surround each occurrence of an abbreviation with <> brackets. Write the marked message to a new text file. For example, if the message to be scanned is How are u today? Iirc, this is your first free day. Hope you are having fun! :) the new text file should contain How are today? , this is your first free day. Hope you are having fun!
<:)>
Text messaging is a popular means of communication. Many abbreviations are in common use but are not appropriate for formal communication. Suppose the abbreviations are stored, one to a line, in a text file named abbreviations.txt. For example, the file might contain these lines:
lol
:)
iirc
4
u
ttfn
The solution for this project makes use of a couple methods that break out the processing of a line. The major method processes and marks a line for a single abbreviation. It finds the index of the abbreviation in the line and then breaks the line up into 3 parts. It then gets the character immediately before and after the abbreviation and checks to see if either is a letter or digit. If so, then we assume that the abbreviation is part of a legal word and don’t mark it. Otherwise, we splice in the <> marker. This is done in a while loop that processes the remaining part of the line until the abbreviation is not found.
See the code in AbbreviationMarker.java.
You might also like to view...
The CONCATENATE function could combine the words Microsoft and Excel into one text string
Indicate whether the statement is true or false
Which of the following is an advantage of Cisco VPNs?
a. It uses 3DES. b. It can handle packets larger than 500 bytes. c. It can create up to 60 virtual tunnels per second. d. All the above.
Each website has a unique HTML address and a corresponding unique domain name.
Answer the following statement true (T) or false (F)
Use the ____________ property to tie a validation control to a specific form control object such as a TextBox object.
Fill in the blank(s) with the appropriate word(s).