예제 #1
0
 def process_single_core(self, filenames):
     """
     Process multiple files sequencially using a single processor
     """
     clusterer = Clusterer(**self.cluster_config)
     for filename in filenames:
         with open(filename, 'r') as f:
             for line in f:
                 clusterer.process_line(line)
     return clusterer.result()
예제 #2
0
 def process_pipe(self):
     """
     Process continuously from stdin input stream
     """
     clusterer = Clusterer(**self.cluster_config)
     try:
         for line in sys.stdin:
             clusterer.process_line(line)
     except KeyboardInterrupt:
         pass
     finally:
         return clusterer.result()