trump-vocabulary/generate_list.py

16 lines
406 B
Python
Raw Permalink Normal View History

2019-07-04 11:57:16 +02:00
#!/usr/bin/env python3
import sys
import bootstrap
import count_words
if __name__ == "__main__":
occur = count_words.filter_unlikely(count_words.process(bootstrap.tweets))
ranked = count_words.ranked_list(occur)
out_file = "trumprank.txt"
if len(sys.argv) >= 2:
out_file = sys.argv[1]
print("Writing out to {}...".format(out_file))
count_words.writeout(ranked, out_file)