Example #1
0
    def process(self, tup):
        request_id, args = tup.values

        args = re.sub(r' {2,}', ' ', args)
        args = [int(x) for x in args.split(' ')]
        total = args[0]

        for arg in args[1:]:
            total += arg

        BasicBolt.emit([request_id, total])
Example #2
0
    def process(self, tup):
        request_id, args = tup.values

        args = re.sub(r' {2,}', ' ', args)
        args = [int(x) for x in args.split(' ')]
        total = args[0]

        for arg in args[1:]:
            total += arg

        BasicBolt.emit([request_id, total])
 def process(self, tup):
     sentence = tup.values[0]
     for word in sentence.split(' '):
         BasicBolt.emit(word)
Example #4
0
 def process(self, tup):
     for word in tup.values:
         self.word_count[word] += 1
         BasicBolt.emit([word, self.word_count[word]])
 def process(self, tup):
     sentence = tup.values[0]
     for word in sentence.split(' '):
         BasicBolt.emit(word)