Words Frequency
import nltk
text1 = ['a', 'b', 'b', 'c', 'c', 'c']
text2 = nltk.FreqDist(text1)
for i in text2:
print("index: %s value: %s" % (i, text2[i]))
for key in text2.keys():
print("index: %s value: %s" % (key, text2[key]))
# The above two statements have the same results as follows:
# index: a value: 1
# index: b value: 2
# index: c value: 3