Example #1
0
def get_proper_nouns(tweets):
    tweet_texts = get_tweet_texts(tweets)

    nouns = []
    for tweet_text in tweet_texts:
        nouns.append(TweetAnalysis.get_proper_nouns(tweet_text))

    return nouns
Example #2
0
def extract_proper_nouns(tweets):
    for key, tweet in enumerate(tweets):
        nouns = TweetAnalysis.get_proper_nouns(tweet[u'nlp'])
        tweet[u'proper_nouns'] = nouns
        tweet[u'proper_nouns_count'] = len(nouns)
        sys.stdout.write("\r%d of %d" % (key, len(tweets) - 1))
        sys.stdout.flush()
    sys.stdout.write("\n")

    return tweets