o
    i                     @   sL   d dl mZ d dlmZ d dlmZ dd Zdd Zedkr!e  dgZ	d	S )
    )pylab)	gutenberg)Textc                    s   |    dd  dD } fdd|D  fddttD t| j td td t	 tj
tt|dd |D d	d
 t  d S )Nc                 S   s   g | ]\}}|qS  r   ).0item_r   r   P/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/nltk/app/wordfreq_app.py
<listcomp>       z'plot_word_freq_dist.<locals>.<listcomp>2   c                    s   g | ]} | qS r   r   )r   sample)fdr   r	   r
      r   c                    s,   g | ]}t d |d  d    qS )N   g      Y@)sumN)r   ir   valuesr   r	   r
      s   , SampleszCumulative Percentagec                 S   s   g | ]}t |qS r   )str)r   sr   r   r	   r
      r   Z   )rotation)vocabmost_commonrangelenr   titlenamexlabelylabelplotxticksshow)textsamplesr   r   r	   plot_word_freq_dist   s   


"r'   c                  C   s   t td} t|  d S )Nzmelville-moby_dick.txt)r   r   wordsr'   )t1r   r   r	   app   s   r*   __main__N)

matplotlibr   nltk.corpusr   	nltk.textr   r'   r*   __name____all__r   r   r   r	   <module>   s   
