Created
March 9, 2013 01:19
-
-
Save masayang/5121985 to your computer and use it in GitHub Desktop.
LongValueSumを指定したMapper
This file contains hidden or 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/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
# 標準入力から読み込む | |
for line in sys.stdin: | |
# strip()を呼び出して余分な空白や改行コードを取り除く | |
line = line.strip() | |
# split()を呼び出して、単語ごとに分ける | |
words = line.split() | |
# 各単語に対して | |
for word in words: | |
# '単語[tab]1'というデータを標準出力に送る | |
print 'LongValueSum:%s\t%s' % (word, 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment