
    gg                         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                          yy)	z.
A utility for displaying lexical dispersion.
c           	      F   	 ddl m} t        t	        |            D ci c]  \  }}|r|j                         n|| }}}g g }
}	t        |       D ]O  \  }}|r|j                         n|}|j                  |      }|.|	j                  |       |
j                  |       Q |ddd   } |j                         \  }}|j                  |	|
d       dt        |       dz
  c|j                  _        |j                  _        |j                  d       |j                  t!        t#        t        |                  |d	
       |j%                  dt        |             |j'                  |       |j)                  d       |S # t        $ r}t        d      |d}~ww xY wc c}}w )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/|   x)axisC0)colorzWord Offset)matplotlib.pyplotpyplotImportError	enumeratereversedcasefoldgetappendsubplotsplotlendataLimx0x1	autoscale
set_ytickslistrangeset_ylim	set_title
set_xlabel)textwordsignore_casetitleplteywordword2yxsysr   token_axs                  I/var/www/openai/venv/lib/python3.12/site-packages/nltk/draw/dispersion.pydispersion_plotr/      sx   ' !%11GAt 'D!31   BdO5$/ UJJu=IIaLIIaL $ $B$KECLLNEArGGBC#$c$i!m BJJM2::=LLcLMM$uSZ()5M=KKCJLLMM- I9  *
 	s   F  F 	F	FF__main__r   N)	gutenberg)ElinorMarianneEdward
Willoughbyzausten-sense.txt)FzLexical Dispersion Plot)
__doc__r/   __name__r   r   r$   nltk.corpusr1   r!   show     r.   <module>r<      sK   
,^ z#%:EOIOO$67?CHHJ r;   