Consider a classical MapReduce application that counts the total number of occurrences of words in a given text. For example, look at WordCount application WordCount.java.
Assume the following classification of words depending on the length of each word.
very short:
1
<
=
length
<
=
3
short:
4
<
=
length
<
=
5
medium:
6
<
=
length
<
=
8
long:
9
<
=
length
<
=
1
2
X long:
1
3
<
=
length
<
=
1
5
XX long:
1
6
<
=
length
Extend Java code of the application such that it counts in a given text the total number of words in each category. For example, the distribution of words in a text that consists of
9
0
words could be the following.
X short:
1
0
words
short:
1
5
words
medium:
3
5
words
long:
2
0
words
X long:
1
0
words
XX long:
0
words
Save your solution in a file solution
3
.
java.
When ready, compile, create jar file, and process your application. To test your application, you can use a file grep.txt included. Display the results created by the application. When finished, Copy and Paste the messages from a Terminal screen into a file solution3.pdf.
Not the question you are looking for? Ask here!
Enter question by text
Enter question by image
Unlock Smarter Learning with AskSia Super!
Join Super, our all-in-one AI solution that can greatly improve your learning efficiency.