Skip to content

Latest commit

 

History

History
33 lines (19 loc) · 567 Bytes

Experiment-2b.md

File metadata and controls

33 lines (19 loc) · 567 Bytes
import nltk
from nltk.corpus import brown,inaugural,genesis
import matplotlib.pyplot as plt
cfd = nltk.ConditionalFreqDist((len(word.lower()),fileid[:4]) 
                               for fileid in inaugural.fileids() 
                               for word in inaugural.words(fileid)
                              if word.isalpha())
cfd.plot(figure=plt.figure(figsize=(18, 16)))

png

cfd.plot(conditions=range(2,6),figure=plt.figure(figsize=(18, 16)))

png