def reducer(key, values, context): sum = 0 for value in values: sum += int(value) context.emit(key, sum)
def mapper(lineNumber, line, context): for word in line.lower().replace(string.punctuation,'').split(' '): context.emit(word, 1)