def on_data(self, data):
        #prints to screen the filtered tweets
        if self.output is None:
            print data
            return True

        #prints to file the filtered tweets without any other actions
        print>>self.output, data.strip()
        if self.adaptive is False:
            return True

        #collects statistics from the tweets collected in the first hours and prints the tweets to file
        if self.adaptive:
            if self.end_time > datetime.datetime.now():
                self.terms = self.terms_fd.keys()[:self.terms_no]
                print "Adding to the query the following terms:"
                print self.terms
                return False

            if self.use_hashtags:
                update_hashtags_stats(self.terms_fd,data)
            else:
                update_terms_stats(self.terms_fd,data,self.lex_set)
            return True
dataset/ETHPy150Open sajao/CrisisLex/src-collect/adaptive_collect.py/AdaptiveListener.on_data/swapped operands of `>`