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