Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

17 lines (12 sloc) 0.398 kB
#!/usr/bin/python
# -*- coding: utf-8 -*-
from r3.worker.mapper import Mapper
class CountWordsMapper(Mapper):
job_type = 'count-words'
def map(self, lines):
#time.sleep(0.5)
return list(self.split_words(lines))
def split_words(self, lines):
for line in lines:
for word in line.split():
yield word.strip().strip('.').strip(','), 1
Jump to Line
Something went wrong with that request. Please try again.