1.Learning Objectives:
1)Use Map data structure to solve problems
2)Use java.util.TreeMap class
3)Use java.util.Scanner class and regular expression to extract tokens from text.
4)Read from file and parse the data
5)Write and test java program
2.General Descriptions:
Write a java program that counts the number of unique words in an input file, ignoring the case and punctuation characters (for example, Map, map, and map. are all map), and print out the words in alphabetic order along with the occurrences of the words.
If wordfile1.txt has the following content:
"Map", "map", and "map." are all "map". Should print out the words in alphabetic order along with the occurrences of the words.
The running output should be:
What is the name of the text file? wordfile1.txt
all=1
along=1
alphabetic=1
and=1
are=1
in=1
map=4
occurrences=1
of=1
order=1
out=1
print=1
should=1
the=3
with=1
words=2
3.Requirements: See the General Descriptions above.
4.References:
1)Koffman & Wolfgang, Data Structures: Abstraction and Design Using Java, 2nd Edition:
2)Lecture notes