Created
April 9, 2019 13:03
-
-
Save prajwal-stha/b980cb4dbedad8967adc0201271730cd to your computer and use it in GitHub Desktop.
Mapper File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
# Word Count Example | |
# input comes from standard input STDIN | |
for line in sys.stdin: | |
# remove leading and trailing whitespaces | |
line = line.strip() | |
# split the line into words and returns as a list | |
words = line.split() | |
for word in words: | |
# write the results to standard output STDOUT | |
# Emit the word | |
print'%s\t%s' % (word, 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment