(Solved) : Question Calculating Occurrences Words Also Need Counter Number Sentences Said Duncan Numb Q44110270 . . .
In the above question, while calculating the occurrences of thewords, we also need a counter of the number of sentences said by”DUNCAN” and number of sentences said by “MALCOLM” in the dataset(i.e. from the play Macbeth).
The excerpts from the play are as below :
DUNCAN. Dismay’d not this
DUNCAN. So well thy words become thee as thy wounds;
DUNCAN. Whence camest thou, worthy Thane?
MALCOLM. What will you do? Let’s not consort with them.
MALCOLM. This murtherous shaft that’s shot
MALCOLM. Let us seek out some desolate shade and there
DUNCAN. Great happiness!
Constraints:
- Assume that the first string/name in each sentence starts withthe person who has spoken that line.
- Use Counters to solve this problem
Hint:
- Add counters to the solution of the above question to get countof the lines spoken by DUNCAN and MALCOLM.
- The value of the counter should be printed in MapReduce outputconsole.
- Refer CountersLinks to an external site. API
Sample Output:
DUNCAN=5
MALCOLM=30
Expected Solution: You need to paste the MRcode, Hadoop commands & path of the final jar that is used toachieve this output.
Expert Answer
Answer to In the above question, while calculating the occurrences of the words, we also need a counter of the number of sentences…
OR