コード例 #1
0
ファイル: stats.py プロジェクト: hackerway/Twitter-Predictor
 def word_data(self):
     '''Word counts and neighbors for all tweets.'''
     all_text = ""
     for user in self._population:
         tweets = user['tweets']
         for tweet in tweets:
             all_text += tweet['text']
     counter = WordCounter(all_text)
     word_data = counter.get_word_data()
     return word_data
コード例 #2
0
ファイル: stats.py プロジェクト: hackerway/Twitter-Predictor
 def word_data(self):
     '''Word counts and neighbors for all tweets.'''
     all_text = ""
     for user in self._population:
         tweets = user['tweets']
         for tweet in tweets:
             all_text += tweet['text']
     counter = WordCounter(all_text)
     word_data = counter.get_word_data()
     return word_data
コード例 #3
0
ファイル: stats.py プロジェクト: hackerway/Twitter-Predictor
 def all_word_data(self):
     '''Returns word counts and neighbors for all of a user's tweets.'''
     for member in self._population:
         if member['uid'] == self._uid:
             found = True
             break
         else:
             found = False
     if not found:
         raise Exception('User not in population: %s' % self._uid)
     all_text = ""
     for tweet in user['tweets']:
         all_text += ' ' + tweet['text']
     counter = WordCounter(all_text)
     word_data = counter.get_word_data()
     return word_data
コード例 #4
0
ファイル: stats.py プロジェクト: hackerway/Twitter-Predictor
 def all_word_data(self):
     '''Returns word counts and neighbors for all of a user's tweets.'''
     for member in self._population:
         if member['uid'] == self._uid:
             found = True
             break
         else:
             found = False
     if not found:
         raise Exception('User not in population: %s' % self._uid)
     all_text = ""
     for tweet in user['tweets']:
         all_text += ' ' + tweet['text']
     counter = WordCounter(all_text)
     word_data = counter.get_word_data()
     return word_data
コード例 #5
0
ファイル: stats.py プロジェクト: hackerway/Twitter-Predictor
 def individual_word_data(self):
     '''Word counts and neighbors for each of a user's tweets.'''
     for member in self._population:
         if member['uid'] == self._uid:
             found = True
             break
         else:
             found = False
     if not found:
         raise Exception('User not in population: %s' % self._uid)
     tweet_data = []
     for tweet in user['tweets']:
         text = tweet['text']
         counter = WordCounter(text)
         word_data = counter.get_word_data()
         tweet_data.append({'id':tweet['id'], 'text':text, \
           'word_data':word_data})
     return tweet_data
コード例 #6
0
ファイル: stats.py プロジェクト: hackerway/Twitter-Predictor
 def individual_word_data(self):
     '''Word counts and neighbors for each of a user's tweets.'''
     for member in self._population:
         if member['uid'] == self._uid:
             found = True
             break
         else:
             found = False
     if not found:
         raise Exception('User not in population: %s' % self._uid)
     tweet_data = []
     for tweet in user['tweets']:
         text = tweet['text']
         counter = WordCounter(text)
         word_data = counter.get_word_data()
         tweet_data.append({'id':tweet['id'], 'text':text, \
           'word_data':word_data})
     return tweet_data