Question: Create a mapper.py and a reducer.py for the following problem: you will read in a file you want to print out how many words have

Create a mapper.py and a reducer.py for the following problem: you will read in a file you want to print out how many words have the exact same type of vowels. For this problem, only the number of vowels matters and the case does not matter (i.e cat is the same as CAt). A vowel is any letter from this set {a,e,i,o,u,y}. A word is any sequence of characters that does not contain whitespace. Whitespace is defined as: space, newline or tab. All of the following are 1 single word:

cats

c@ts

ca7s cats.and:d0gs!

The output will be the vowel set, followed by a colon, followed by the number of words that contained exactly the vowel set. The output will have one answer per line (see example below).

Example:

hello and pole both contain exactly 1 e and exactly 1 o. The order of the vowels from the original input word does not matter.

Imagine the following example:

hello moose pole cccttt.ggg

We would end up with the following output:

:1

eo:2

eoo:1

The format should be as seen above: the vowels on each line are in alphabetical order, followed by a colon, then followed by the number of words that contained exactly those vowels. If there are words with no vowels, nothing is printed before the colon.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!