Last active
November 6, 2017 20:47
-
-
Save Joshuaek/70d4e3e85b0cfa50337f059064eb1b31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
words = [] | |
for tweet in tweets: | |
words.extend(prepareSentence(tweet["text"])) | |
distinct_words = set(words) | |
lower_threshold = 10 | |
upper_threshold = 350 | |
counts = [] | |
final_words = [] | |
for word in distinct_words: | |
counts.append(words.count(word)) | |
if words.count(word) > lower_threshold and words.count(word) < upper_threshold: | |
final_words.append(word) | |
print(len(words)) | |
print(len(distinct_words)) | |
print(len(final_words)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment