
    '[f>                         d Z d
dZedk    r;ddlmZ ddlmZ g dZ e ej        d	          e            ej	                     dS dS )z.
A utility for displaying lexical dispersion.
FLexical Dispersion Plotc           	         	 ddl m} n"# t          $ r}t          d          |d}~ww xY wfdt          t	          |                    D             }g g }}t          |           D ]^\  }	}
r|
                                n|
}
|                    |
          }|*|                    |	           |                    |           _ |j                    \  }}|	                    ||d           |
                    t          t          t          |                              |d           |                    dt          |                     |                    |           |                    d	           |S )
a  
    Generate a lexical dispersion plot.

    :param text: The source text
    :type text: list(str) or iter(str)
    :param words: The target words
    :type words: list of str
    :param ignore_case: flag to set if case should be ignored when searching text
    :type ignore_case: bool
    :return: a matplotlib Axes object that may still be modified before plotting
    :rtype: Axes
        NzRThe plot function requires matplotlib to be installed. See https://matplotlib.org/c                 H    i | ]\  }}r|                                 n||S  )casefold).0ywordignore_cases      H/var/www/piapp/venv/lib/python3.11/site-packages/nltk/draw/dispersion.py
<dictcomp>z#dispersion_plot.<locals>.<dictcomp>#   s@       At '0D!      |C0)colorzWord Offset)matplotlib.pyplotpyplotImportError	enumeratereversedr   getappendsubplotsplot
set_ytickslistrangelenset_ylim	set_title
set_xlabel)textwordsr   titleplteword2yxsysxtokenr	   _axs     `           r   dispersion_plotr/      s   '''''''   *
 
 	    %11  F BdOO  5$/:   UJJu=IIaLLLIIaLLLCLNNEArGGBCMM$uSZZ(())5M===KKCJJLLMM-   Is   
 
)$)__main__r   N)	gutenberg)ElinorMarianneEdward
Willoughbyzausten-sense.txt)Fr   )
__doc__r/   __name__r   r   r&   nltk.corpusr1   r$   showr   r   r   <module>r:      s    
( ( ( (V z######%%%%%%:::EOOIO$677???CHJJJJJ r   