Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assume, that a text file crime-stories.txt contain the texts of the large number of crime stories. Assume, that the file is formatted such that one
Assume, that a text file crime-stories.txt contain the texts of the large number of crime stories. Assume, that the file is formatted such that one statement is located in one line of the text file.
Assume, that a text file patterns.txt contains the text patterns, for example regular expressions. Assume, that the file is formatted, such that one pattern is located in one line of the text file.
To simplify the problem, assume that all text patterns in a file patterns.txt are distinct. Finally, assume that a function match(text-line, text-pattern) returns true when text line matches a pattern text-pattern. Otherwise, the function returns false.
You must specify the parameters (if any) of your application and the key-value data in the input and output of the Map and Reduce stages.
There is no need to write Java code, however, if you like it then it is all right to do so. The precise explanations in plain English or in a pseudocode will do. Please note, that if you decide to use pseudocode then your explanations must precisely explain what happens at each stage of Map- Reduce application
Assume, that a text file patterns.txt contains the text patterns, for example regular expressions. Assume, that the file is formatted, such that one pattern is located in one line of the text file.
To simplify the problem, assume that all text patterns in a file patterns.txt are distinct. Finally, assume that a function match(text-line, text-pattern) returns true when text line matches a pattern text-pattern. Otherwise, the function returns false.
You must specify the parameters (if any) of your application and the key-value data in the input and output of the Map and Reduce stages.
There is no need to write Java code, however, if you like it then it is all right to do so. The precise explanations in plain English or in a pseudocode will do. Please note, that if you decide to use pseudocode then your explanations must precisely explain what happens at each stage of Map- Reduce application
Step by Step Solution
There are 3 Steps involved in it
Step: 1
So to implement a MapReduce application that finds the total number of statements in a file crimestoriestxt that match each pattern in patternstxt you ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started