Exemplo n.º 1
0
def calculate_all_tweets(input_file):
    sanitizer = TweetSanitizer()
    graph = TweetGraphDegree()
    with open(input_file) as tweets_in:
        for line in tweets_in:
            tweet = sanitizer.sanitize_tweet(line)
            graph.add_tweet(tweet)
            degree = graph.average_degree()
            write_line('{:0.2f}'.format(degree))
Exemplo n.º 2
0
def calculate_all_tweets(input_file):
    sanitizer = TweetSanitizer()
    graph = TweetGraphDegree()
    with open(input_file) as tweets_in:
        for line in tweets_in:
            tweet = sanitizer.sanitize_tweet(line)
            graph.add_tweet(tweet)
            degree = graph.average_degree()
            write_line('{:0.2f}'.format(degree))
 def get_graph_from_tweets(self, tweets):
     '''Creates a degree graph from provided list of tweets'''
     graph = TweetGraphDegree()
     for tweet in tweets:
         graph.add_tweet(tweet)
     return graph
Exemplo n.º 4
0
 def get_graph_from_tweets(self, tweets):
     '''Creates a degree graph from provided list of tweets'''
     graph = TweetGraphDegree()
     for tweet in tweets:
         graph.add_tweet(tweet)
     return graph