def mapper(self, _, line):
    words = WORD_RE.findall(line)
    for i in izip(words, islice(words, 1, None), islice(words, 2, None)):
        bigram = (i[0], i[1], i[2])
        s_bigram = sorted(bigram)
        (yield (s_bigram, 1))
def mapper(self, _, line):
    words = WORD_RE.findall(line)
    for i in izip(words, islice(words, 1, None), islice(words, 2, None)):
        bigram = (i[0], i[1], i[2])
        s_bigram = sorted(bigram)
        (yield (s_bigram, 1))