Пример #1
0
from util import readTweetObjects
from MyTweet import MyTweet
from app import App

tweetSamples = readTweetObjects('apple.json')
tweets = []
cnt = 0
for t in tweetSamples:
    mytweet = MyTweet(t)
    tweets.append(MyTweet(t))
    cnt += 1

app = App()
X = app.getFeatures(tweets)
clusters = app.clusterAndRank(X,3,tweets,True)
app.present(clusters,3)



Пример #2
0
from MyTweet import MyTweet
from util import readTweetObjects

tweetSamples = readTweetObjects("tweetObjects.json")


for tweet in tweetSamples:
    myTweet = MyTweet(tweet)
    # print myTweet.parseUrl(tweet.entities)
    # print myTweet.isRetweet
    print "{}: {}".format(myTweet.timezone, tweet.user.time_zone)

    print tweet.text
    print myTweet.processedText
    print