#!/usr/bin/env python# http://www.michael-noll.com/tutorials/writing-an-hadoop-mapreduce-program-in-python/importsys# input comes from STDIN (standard input)forlineinsys.stdin:# remove leading and trailing whitespaceline=line.strip()# split the line into wordswords=line.split()# increase countersforwordinwords:# write the results to STDOUT (standard output);# what we output here will be the input for the# Reduce step, i.e. the input for reducer.py## tab-delimited; the trivial word count is 1print'%s\t%s'%(word,1)