Please refer to the below blog that describe the Wordcount in MRV2.

Please find the document attached that consists of detailed explanation of  other Map Reduce Codes as well such as - Temperature, Hot and Cold Day, Patents etc MR  Assignment. It consists of the comments of the logic performed in the Map Reduce Program wherever it is necessary.

Please feel free to revert if you need any further help