
    /h                         S r SSKrSSKrSSKrSSKrSSKJrJrJrJ	r	J
r
JrJrJrJrJr  SSKJrJr  SSKJr  SSKJrJr  SSKJr  SSKJrJr  SS	KJr  SS
KJ r   SSK!J"r"   " S S5      r#S r$\%S:X  a  \$" 5         S/r&g)zl
A graphical tool for exploring the regular expression based chunk
parser ``nltk.chunk.RegexpChunkParser``.
    N)
ButtonCanvasCheckbuttonFrameIntVarLabelMenu	ScrollbarTextTk)askopenfilenameasksaveasfilename)Font)
ChunkScoreRegexpChunkParser)RegexpChunkRule)	conll2000treebank_chunk)ShowText)Tree)in_idlec                      \ rS rSrSr0 SS_SS_SS_S	S
_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS _S!S"_S#S$_0 S%S&_S'S(_S)S*_S+S,_S-S._S/S0_S1S2_S3S4_S5S6_S7S8_S9S:_S;S<_S=S>_S?S@_SASB_SCSD_SESF_ESGSHSISJSKSLSMSNSOSPSQSR.Er/ SSQrST\" SUSV94SW\" SXSV94SY\" SZS[94S\\" S]S^94S_\" S]S^94S`\" SaSaSb94Sc\" SdSeSb94Sf\" SgSV94Sh\" SiSV94Sj\" SkSV94/
rSlr	 Smr
 Snr Sor Spr \" SqSrSsSsSlStSuSvSw9r\" SmSmSsSsSxSlStSuSvSy9	r\" SzS{S|S|SlStSuSvS}S~9	r\" SStSuS9r\" SSS9r\" SSuSuSS9r\" S|S|SlStSuSSS9r\" SSSS9rSrSsr\" SsS[9r\" SS[9rSrS r     SS jrS rS rS rS r Sr!Sr"S r#Sr$S r%S r&S r'Sr(S r)S r*S r+S r,S r-S r.S r/S r0S r1SS jr2S r3S r4S r5S r6SS jr7S r8S r9S r:Sr;SS jr<SS jr=SS jr>S r?SS jr@SS jrAS rBSrCg)RegexpChunkApp-   z
A graphical tool for exploring the regular expression based chunk
parser ``nltk.chunk.RegexpChunkParser``.

See ``HELP`` for instructional text.
CCzCoordinating conjunctionzPRP$zPossessive pronounCDzCardinal numberRBAdverbDT
DeterminerRBRzAdverb, comparativeEXzExistential thereRBSzAdverb, superlativeFWzForeign wordRPParticleJJ	AdjectiveTOtoJJRzAdjective, comparativeUHInterjectionJJSzAdjective, superlativeVBzVerb, base formLSzList item markerVBDzVerb, past tenseMDModalNNSzNoun, pluralNNzNoun, singular or massVBNzVerb, past participleVBZzVerb,3rd ps. sing. presentNNPzProper noun, singularNNPSzProper noun pluralWDTzwh-determinerPDTPredeterminerWPz
wh-pronounPOSzPossessive endingzWP$zPossessive wh-pronounPRPzPersonal pronounWRBz	wh-adverb(zopen parenthesis)zclose parenthesisz
open quotecommazclose quoteperiodzpound sign (currency marker)zdollar sign (currency marker)zPreposition/subord. conjunctionz#Symbol (mathematical or scientific)zVerb, gerund/present participlezVerb, non-3rd ps. sing. presentcolon)z``,z''.#$INSYMVBGVBP:))Help20a-  Welcome to the regular expression chunk-parser grammar editor.  You can use this editor to develop and test chunk parser grammars based on NLTK's RegexpChunkParser class.

Use this box ('Help') to learn more about the editor; click on the tabs for help on specific topics:<indent>
Rules: grammar rule types
Regexps: regular expression syntax
Tags: part of speech tags
</indent>
Use the upper-left box ('Grammar') to edit your grammar.  Each line of your grammar specifies a single 'rule', which performs an action such as creating a chunk or merging two chunks.

The lower-left box ('Development Set') runs your grammar on the development set, and displays the results.  Your grammar's chunks are <highlight>highlighted</highlight>, and the correct (gold standard) chunks are <underline>underlined</underline>.  If they match, they are displayed in <green>green</green>; otherwise, they are displayed in <red>red</red>.  The box displays a single sentence from the development set at a time; use the scrollbar or the next/previous buttons view additional sentences.

The lower-right box ('Evaluation') tracks the performance of your grammar on the development set.  The 'precision' axis indicates how many of your grammar's chunks are correct; and the 'recall' axis indicates how many of the gold standard chunks your system generated.  Typically, you should try to design a grammar that scores high on both metrics.  The exact precision and recall of the current grammar, as well as their harmonic mean (the 'f-score'), are displayed in the status bar at the bottom of the window.)Rules10a  <h1>{...regexp...}</h1><indent>
Chunk rule: creates new chunks from words matching regexp.</indent>

<h1>}...regexp...{</h1><indent>
Strip rule: removes words matching regexp from existing chunks.</indent>

<h1>...regexp1...}{...regexp2...</h1><indent>
Split rule: splits chunks that match regexp1 followed by regexp2 in two.</indent>

<h1>...regexp...{}...regexp...</h1><indent>
Merge rule: joins consecutive chunks that match regexp1 and regexp2</indent>
)Regexps10 60aZ  <h1>Pattern		Matches...</h1>
<hangindent>	<<var>T</var>>	a word with tag <var>T</var> (where <var>T</var> may be a regexp).
	<var>x</var>?	an optional <var>x</var>
	<var>x</var>+	a sequence of 1 or more <var>x</var>'s
	<var>x</var>*	a sequence of 0 or more <var>x</var>'s
	<var>x</var>|<var>y</var>	<var>x</var> or <var>y</var>
	.	matches any character
	(<var>x</var>)	Treats <var>x</var> as a group
	# <var>x...</var>	Treats <var>x...</var> (to the end of the line) as a comment
	\<var>C</var>	matches character <var>C</var> (useful when <var>C</var> is a special character like + or #)
</hangindent>
<h1>Examples:</h1>
<hangindent>	<regexp><NN></regexp>
		Matches <match>"cow/NN"</match>
		Matches <match>"green/NN"</match>
	<regexp><VB.*></regexp>
		Matches <match>"eating/VBG"</match>
		Matches <match>"ate/VBD"</match>
	<regexp><IN><DT><NN></regexp>
		Matches <match>"on/IN the/DT car/NN"</match>
	<regexp><RB>?<VBD></regexp>
		Matches <match>"ran/VBD"</match>
		Matches <match>"slowly/RB ate/VBD"</match>
\t<regexp><\#><CD> # This is a comment...</regexp>\n		Matches <match>"#/# 100/CD"</match>
</hangindent>)TagsrT   zB<h1>Part of Speech Tags:</h1>
<hangindent><<TAGSET>></hangindent>
redz#a00
foregroundgreenz#080	highlightz#ddd
background	underlineT)r]   h1indent   lmargin1lmargin2
hangindentr   <   varz#88fregexpz#ba7matchz#6a6      g?g{Gz?g{Gz?(      z#efegroove   word)widthheightr\   highlightbackgroundhighlightthicknessreliefborderwrapz#555)	rp   rq   r\   rr   rX   rs   rt   ru   rv   F   
   z#eef)   )	rp   rq   r\   rr   rs   rt   ru   rv   tabsz#9bb)r\   rt   ru   	helveticaifamilysizez#777   )r\   padxpadyru   i,  i  )r\   rr   rs   rt   ru   rp   rq   )r\   activebackgroundrr   z#aba   c                     [         R                  " SSU5      n[         R                  " SSU5      n[         R                  " SSU5      nUR                  5       n[         R                  " SSU5      nU$ )	N((\\.|[^#])*)(#.*)?\1z + z\n\s+z\nz	([^\\])\$z\1\\$)resubstrip)selfgrammars     P/var/www/auris/envauris/lib/python3.13/site-packages/nltk/app/chunkparser_app.pynormalize_grammar RegexpChunkApp.normalize_grammar4  s[    &&/@&&sG,&&5'2--/&&x9    Nc                 *   X@l         Uc  U R                  nXPl        UcG  US:X  a  [        R                  " S5      nO*US:X  a  [
        R                  " 5       nO[        SU-  5      eSU l         X0l         SU l	         SU l
         X l         Xl         SU l         SU l         / U l         SU l         SU l         SU l         SU l         [)        US9U l         [-        5       =o`l        UR1                  S	5        UR3                  S
5        UR5                  SU R6                  5        [9        U5      U l        U R:                  R=                  S5        U R?                  U5        U RA                  U5        U RC                  U5        U RE                  U5        U RF                  RI                  5         U(       a;  U RF                  RK                  SUS-   5        U RF                  RM                  SS5        U RO                  S5        U RQ                  5         g)a  
:param devset_name: The name of the development set; used for
    display & for save files.  If either the name 'treebank'
    or the name 'conll2000' is used, and devset is None, then
    devset will be set automatically.
:param devset: A list of chunked sentences
:param grammar: The initial grammar to display.
:param tagset: Dictionary from tags to string descriptions, used
    for the help page.  Defaults to ``self.TAGSET``.
Nr   z	train.txttreebankzUnknown development set %sr   chunk_labelz+50+50zRegexp Chunk Parser Appz<Control-q>d   end
insert1.0))_chunk_labelTAGSETtagsetr   chunked_sentsr   
ValueErrorchunkerr   normalized_grammargrammar_changeddevsetdevset_namedevset_index_last_keypress_history_history_index_eval_grammar_eval_normalized_grammar_eval_indexr   _eval_scorer   topgeometrytitlebinddestroyr   _devset_sizeset_init_fonts_init_widgets_init_bindings_init_menubar
grammarboxfocusr   mark_setshow_devsetupdate)r   r   r   r   r   r   r   s          r   __init__RegexpChunkApp.__init__?  s   $ (>[[F >k)"00=:%'557 !=!KLL7)"&7 ;A&?	-  =	8  	I "	 )-%5	5 &+>	: hX		+,- #3Kc" 	3C 3 OO""5'D.9OO$$Xu5 	r   c                 n  ^  UR                  ST R                  5        UR                  ST R                  5        UR                  ST R                  5        UR                  ST R                  5        UR                  SU 4S j5        UR                  SU 4S j5        T R
                  R                  ST R                  5        T R
                  R                  ST R                  5        T R
                  R                  ST R                  5        T R                  R                  S	T R                  5        g )
Nz<Control-n>z<Control-p>z<Control-t>z
<KeyPress>z<Control-s>c                 $   > TR                  5       $ N)save_grammarer   s    r   <lambda>/RegexpChunkApp._init_bindings.<locals>.<lambda>      $*;*;*=r   z<Control-o>c                 $   > TR                  5       $ r   )load_grammarr   s    r   r   r     r   r   z<Configure>)r   _devset_next_devset_prevtoggle_show_tracer   r   evalbox
_eval_plotr   r   s   ` r   r   RegexpChunkApp._init_bindings  s     1 12 1 12 6 67t{{+ => =>]D,B,BC]D,=,=>]D,=,=> 	-9r   c                    [        U5      U l        U R                  R                  S5        [        SU R                  R	                  5       * S9U l        [        S[        U R                  R	                  5       S-  S-  5      * S9U l        g )Nr`   r{   r|      )r   _sizer   r   get_fontint
_smallfontr   s     r   r   RegexpChunkApp._init_fonts  sg    C[


rDJJNN4D3DE
s4::>>+;b+@B+F'G%H
r   c                    [        U5      n[        USS9nUR                  SSU R                  S9  UR                  SSSU R                  S9  UR                  SSS	U R                  S9  UR                  S
SU R
                  S9  UR                  SSU R                  SS9  UR                  SSUS9  [        USS9nUR                  SU R                  SSU R                  S9  UR                  SU R                  SSU R                  S9  UR                  SU R                  SSU R                  S9  UR                  SU R                  SSU R                  S9  UR                  SU R                  SSU R                  S9  UR                  SSUS9  [        USS9nUR                  SU R                  SU R                  S 9  UR                  S!U R                  S"U R                  S 9  UR                  S#U R                  S$U R                  S 9  UR                  S%U R                  S&U R                  S 9  UR                  S'SUS9  [        USS9nUR                  S(SU R                  S9  UR                  S)SUS9  UR                  US*9  g )+Nr   )tearoffzReset Application)labelr]   commandzSave Current GrammarzCtrl-s)r   r]   acceleratorr   zLoad GrammarzCtrl-ozSave Grammar History   Exitri   zCtrl-q)r   r]   r   r   File)r   r]   menuTinyrx   )r   variabler]   valuer   Small   Mediumr`   Large   Huge"   Viewz50 sentences2   )r   r   r   r   z100 sentencesr   z200 sentences   z500 sentencesi  zDevelopment-SetAboutrO   )r   )r	   add_commandresetr   r   save_historyr   add_cascadeadd_radiobuttonr   resizer   set_devset_sizeaboutconfig)r   parentmenubarfilemenuviewmenu
devsetmenuhelpmenus          r   r   RegexpChunkApp._init_menubar  s   v,+#6!TZZX( %%	 	 	
 	  %%	 	 	
 	(B@Q@Q 	 	
 	At|| 	 	
 	&AHE+  ZZKK 	! 	
 	  ZZKK 	! 	
 	  ZZKK 	! 	
 	  ZZKK 	! 	
 	  ZZKK 	! 	
 	&AHE'1-
"" &&((	 	# 	
 	""!&&((	 	# 	
 	""!&&((	 	# 	
 	""!&&((	 	# 	
 	"3qzR+7aL&AHE7#r   c                 h    U R                   (       a  U R                  5         gU R                  5         g)Nbreak)_showing_tracer   
show_tracer   r   s     r   r    RegexpChunkApp.toggle_show_trace#  s+      OOr      Fc                 |
   UR                  SU R                  R                  5       5      nUR                  SU R                  R                  5       5      nU R                  R	                  S5        U R                  R                  SUS-  S-
  SSSS	9nU R                  R                  U5      S   S
-   US-
  pvU R                  R                  XcU-
  S-  -   US-
  SSSS9nSU R                  R                  U5      S   S-
  pU R                  S   n
U R                  R                  U R                  R                  SSUS-
  SXS95        U R                  R                  U R                  R                  SU	S-   SSXS95        U R                  R                  5       (       a  [        U R                  5      S:  a  S=pS=p[        S[        [        U R                  5      U R                  S-   5      5       HH  nU R                  U*    u  nnnn[        UU5      n[        UU5      n[!        UU5      n[!        UU5      nMJ     [!        US-
  S5      n[!        US-
  S5      n[        US-   S5      n[        US-   S5      nOS=pS=p[        S5       H  nXgU-
  US-  U-
  X-
  -  -  -   nXU-
  US-  U-
  X-
  -  -  -
  nUUs=:  a  U:  a   O  OU R                  R#                  UUUU	SS9  UUs=:  a  U	:  d  Mi  O  Mm  U R                  R#                  UUUUSS9  M     U R                  R#                  XhXi5        U R                  R#                  XiXy5        U R                  R                  US-
  U	SSSSU-  -  S	9  U R                  R                  US-
  USSSSU-  -  S	9  U R                  R                  UU	S-   SSSSU-  -  S	9  U R                  R                  UU	S-   SSSSU-  -  S	9  S =nn[%        U R                  5       GH0  u  nu  nnnnXgU-
  UU-
  X-
  -  -  -   nXU-
  UU-
  X-
  -  -  -
  nXR&                  :X  aR  U R                  R)                  US-
  US-
  US-   US-   S S!S9  S"US-  -  S#US-  -  -   S$US-  -  -   U R*                  S%'   OCU R                  R                  U R                  R)                  US-
  US-
  US-   US-   S&S'S95        UbU  U R,                  R                  5       (       a6  U R                  R                  U R                  R#                  UUUUS'S95        UUnnGM3     g )(Nrp   rq   allrx   rn   leftw	Precision)justifyanchortextr  sRecallcenter)r  r  r  ri   r\   r   i  )filloutlineg{Gz?   g      $@z#888)r  r   rightsez%d%%r   nenwz#0f0z#000zPrecision: %.2f%%	zRecall: %.2f%%	zF-score: %.2f%%r  #afaz#8c8)r   r   winfo_widthwinfo_heightdeletecreate_textbbox_EVALBOX_PARAMSlowercreate_rectangle
_autoscalelenr   rangemin_SCALE_Nmaxcreate_line	enumerater   create_ovalstatus_eval_lines)r   r   r   rp   rq   tagr	  r  r   botbgmax_precision
max_recallmin_precision
min_recallir   	precisionrecallfmeasurexyprev_xprev_y_fscores                             r   r   RegexpChunkApp._eval_plot-  s   

7DLL$<$<$>?Hdll&?&?&AB 	E" ll&&!b &; ' 
 ll'',Q/!3URZell&&DLQ&&RK ' 
 t||((-a025S !!,/LL))!Qq$R)T	
 	LL))!S1WdDr)V	

 ??  S%7!%;)**M)**M1c#dmm"4dmma6GHI7;}}aR7H4FH #I} = 4
 #I} = 4
 J$   4a8MZ$.2J 4a8MZ$.2J)**M)**M rATJ&:+BC A SyTM)m.KL A a%((CCf(EQ}}}((q%(H  	  D6  E7 	  1H3./ 	! 	
 	  1H3./ 	! 	
 	  !G3+, 	! 	
 	  !G3+, 	! 	
 1:4==1I-A-9ff*$)@A A Sy]*}/LM A '''((E1q5!a%QVV )  *Y_=(FSL9:'6C<89 F# ""LL,,Aq1ua!eQU - 
 !d&6&6&:&:&<&<""LL,,VVQ,O FFF5 2Jr   c                    U R                   c  g U R                  c  SU l        g [        R                  " 5       n[        R                  " 5       U R                  -
  U R
                  :  a]  U R                  U R                  :w  aC  SU l        U R                   R                  [        U R                  S-  5      U R                  5      $ U R                  U R                  :w  a  U R                   H  u  p#pEU R                  U R                  U5      :X  d  M'  U R                  R                  X#XE45        [        U R                  5      S-
  U l        U R#                  5         SU l        S U l          g    SU l        ['        U R(                  S9U l        U R,                  U l        U R                  U l        U R                  R1                  5       S:X  a  SU l        g U R2                  U R$                  [5        U R$                  U R6                  -   U R8                  R;                  5       5        H=  nU R=                  UR?                  5       5      nU R*                  RA                  Xg5        M?     U =R$                  U R6                  -  sl        U R$                  U R8                  R;                  5       :  a  U R                  R                  U R.                  U R*                  RC                  5       U R*                  RE                  5       U R*                  RG                  5       45        [        U R                  5      S-
  U l        U R#                  5         SU l        S U l        g SU R$                  -  U R8                  R;                  5       -  nS	U-  U RH                  S
'   SU l        U RK                  [        R                  " 5       U-
  5        U R                   R                  [        U R                  S-  5      U R                  5        g )NFTi  ri   r   r    r   z$Evaluating on Development Set (%d%%)r  )&r   r   _eval_demon_runningtimer   _EVAL_DELAYr   r   afterr   
_EVAL_FREQ_eval_demonr   r   appendr#  r   r   r   r   r   r   r   r   r   r   r%  _EVAL_CHUNKr   r   _chunkparseleavesscorer5  r6  	f_measurer+  _adaptively_modify_eval_chunk)	r   t0gprfgoldguessprogresss	            r   rF  RegexpChunkApp._eval_demon  s2   88<<',D$ YY[ IIK$---0@0@@''4+H+HH'+D$88>>#doo&<"=t?O?OPP ""d&C&CC #mm
a**d.D.DQ.GGMM((!6*-dmm*<q*@D'OO%/4D,48D1 ,  !D)d6G6GHD!%D,0,C,CD) ""((*b0',D$ KKs  4#3#33T5F5F5J5J5L 
D
 $$T[[]3E""4/
 	D,,, t004466MM  &&$$..0$$++-$$..0	 #&dmm"4q"8DOO',D$,0D)T---0A0A0E0E0GGH"H8"SDKK'+D$..tyy{R/?@HHNN3t568H8HIr   c           
         XR                   :  ai  U R                  S:  aY  [        U R                  S-
  [        [	        U R                  U R                   U-  -  5      U R                  S-
  5      5      U l        gXR
                  :  aY  [        U R                  S-   [        [	        U R                  U R
                  U-  -  5      U R                  S-   5      5      U l        gg)z
Modify _EVAL_CHUNK to try to keep the amount of time that the
eval demon takes between _EVAL_DEMON_MIN and _EVAL_DEMON_MAX.

:param t: The amount of time that the eval demon took.
r  ri   rx   N)_EVAL_DEMON_MAXrH  r%  r'  r   _EVAL_DEMON_MIN)r   ts     r   rM  ,RegexpChunkApp._adaptively_modify_eval_chunk  s     ###(8(81(<"  1$((D,@,@1,DEF$$r) D %%%"  1$((D,@,@1,DEF$$r) D &r   c           	      6  ^  [        U40 T R                  D6nUR                  SSS9  UR                  SSS9  UR                  SSS9  UR                  SSS9  [	        U4ST R
                  0T R                  D6T l        [        UT R
                  S	S
T R                  S   S9T l	        T R                  R                  SSSS9  T R                  R                  SSSS9  [        UT R                  R                  S9nUR                  SSSS9  T R                  R                  UR                  S9  T R                  S   n[        X$S9nUR                  SSSS9  [        U4ST R                   S.T R"                  D6R%                  SS9  [        U4ST R&                  S.T R"                  D6R%                  SS9  [	        U4ST R(                  0T R*                  D6T l        T R,                  R                  SSSS9  0 T l        T R                  S   n[        X$S9nUR                  SSSS9  [1        T R2                  5       H  u  nu  pn
[        XhT R(                  S9nUR                  US-  SSS9  UR5                  SU4U 4S jj5        UT R.                  U'   [        UST R6                  US9R                  US-  S-   SS9  M     T R.                  T R2                  S   S      R9                  T R
                  S 9  T R,                  R;                  S!S"S#9  T R<                   H%  u  pT R,                  R:                  " S$U-  40 UD6  M'     T R?                  T R2                  S   S   5        [        UT R,                  R                  S9nT R,                  R                  UR                  S9  UR                  SSSS9  [        UT R                  S   S9n[	        U4ST R
                  0T R@                  D6T l!        T RB                  R%                  S"S%S&9  [        UT R
                  S'S(T R@                  S   S)9T l"        T RD                  R                  SSSS9  UR                  SSSS9  [        UT RF                  S9T l$        T RH                  R                  SSSS9  [        UT RB                  RJ                  S*S+9T l&        T RL                  R                  T RB                  S,'   T RL                  R%                  S-S.S/9  T R                  S   n[        X$S9nUR                  SS0SS9  [        U4S1T RN                  S.T R"                  D6R%                  SS9  [        U4S2T RP                  S.T R"                  D6R%                  SS9  [        U4S3T RR                  S4S5.T R"                  D6T l*        T RT                  R%                  S(S9  [        U4S6T RV                  S.T R"                  D6T l,        T RX                  R%                  S(S9  [[        U40 T R\                  D6T l/        [        UT R
                  S7S(T R\                  S   S)9nUR                  SSSS9  T R^                  R                  SSSSS89  T R                  S   n[        X$S9nUR                  SS0SS9  [a        T Rb                  5      T l2        T Rd                  R                  S95        [g        U4T Rd                  T Rh                  S:S;.T R"                  D6R%                  SS9  [a        T Rb                  5      T l5        T Rj                  R                  S95        [g        U4T Rj                  T Rh                  S<S;.T R"                  D6R%                  SS9  [        U4S=S>0T R"                  D6R%                  S(S9  [        U4ST R
                  0T Rl                  D6T l7        T Rn                  R                  SS?S@SSSSA9  S4T R,                  SB'   S4T RB                  SB'   T R                  S   n[        USCSUS9R                  SSS9  [        USSCUS9R                  SSS9  [        USDSUS9R                  SSES9  UR%                  S%S"SF9  T RB                  R;                  SGSHSISJ9  T RB                  R;                  SKSISLSM9  T RB                  R;                  SNSOS9  T RB                  R;                  SPSQSRSS9  T RB                  R;                  STSUSRSV9  T RB                  R;                  SWSLSX9  T R                  R;                  SWSYS9  T R                  R;                  SZS[SX9  T R                  R;                  S\S]SX9  T R                  R;                  S^S_SX9  T R                  R;                  S`SSaSb9  g )cNr      )weightr   rn   ri   r  fontGrammar:blackr\   )r_  r  highlightcolorr\   SW)columnrowstickyNEWS)r   NWS)yscrollcommandr[   EWzPrev Grammar)r  r   r	  )sidezNext Grammar)r  r_  Sz<ButtonPress>c                 &   > TR                  U5      $ r   )	show_help)r   tabr   s     r   r   .RegexpChunkApp._init_widgets.<locals>.<lambda>N  s    4>>#;Nr   )rq   rp   r\   )rd  re  )r_  elideT)rq  tag-%sboth)expandr  zDevelopment Set:r  )r_  r  r  r\   horiz)r   orientxscrollcommandbottomr8  )rk  r     zPrev Example (Ctrl-p)zNext Example (Ctrl-n)zShow exampledisabled)r  r   statez
Show tracezEvaluation:)rd  re  rf  
columnspanFZoom)r   r   r  Linesr  History	   NEW)rd  re  rf  r   r   r|  r{  rx   r      )r  rt  true-posr  True)r\   r]   	false-negz#800)r]   rX   	false-posz#faatracez#666none)rX   rv   
wrapindentry   )rc   rv   errorrW   z#feccommentz#840anglez#00fbracez#0a0rd   rk   ra   )8r   _FRAME_PARAMSgrid_columnconfiguregrid_rowconfigurer   r   _GRAMMARBOX_PARAMSr   r   grammarlabelgridr
   yviewr   r   r   _history_prev_BUTTON_PARAMSpack_history_nextr   _HELPBOX_PARAMShelpboxhelptabsr)  HELPr   _HELPTAB_SPACER	configure
tag_configHELP_AUTOTAGrn  _DEVSETBOX_PARAMS	devsetboxdevsetlabel_devset_scrolldevset_scrollxviewdevset_xscrollr   r   r   devset_buttonr  trace_buttonr   r  r   r   r   r"  r   r   r,  _STATUS_PARAMSr+  )r   r   frame0grammar_scrollbarr/  frame3helptab_framer4  ro  tabstopsr  r   r-  paramshelp_scrollbarframe4frame1frame2s   `                 r   r   RegexpChunkApp._init_widgets  s~	   s1d001##Aa#0##Aa#0  1 -  1 - vRDJJR$:Q:QR!"..|<
 	aQt<A1V< &fdoo6K6KLaQu=.?.C.CD -v-1!D1	
&&	
 !!		

 $F$
	
&&	
 !!		

 $F$
 FQQD<P<PQ&9-f4!48(1$))(<$A$t-HEJJa!e3J7 JJc(NO!&DMM#at/C/CPRd!a%!)d+ )= 	diil1o&00djj0At4,,KCLL##HsN=f= -tyy|A' #64<<3E3EF>+=+=>1!E: v$*<*<\*JKfP4::P9O9OP4f5 #--l;
 	QAd;1!F3 'vt7J7JKqa>'DNN00
 ,0+>+>+B+B'(  hS 9 -v-1!D1	
(%%	
 !!		

 $F$
	
(%%	
 !!		

 $F$
#
$$	

 !!
 	W-"
%t
BFBUBU
 	G, f=(<(<=++L9
 	

!4
0&QG -v-1!D1 *E"	
__OO		

 !!	
 $F$
!$((+U#	
%%OO		

 !!	
 $F$
v=I=)<)<=BBBP FKKt7J7JKqQQSTU !+W",w -fRqR8==QA=NfQbR8==QA=NfQaB7<<A1<M 	- 	!!*6!R!!+F!S!!+&!A!!'f6!J!!,&!I!!'f!= 	""7v">""9"@""7v">""7v">""<!b"Ir   c           	         SU l         SU R                  S'   SU R                  S'   SU R                  S'   U R                  R	                  SS5        SU R
                  S-   U R                  R                  5       4-  U R                  S	'   U R                  c:  U R                  R                  SS
5        U R                  R                  SSS5        g U R                  U R
                     nU R                  R                  5       nSnS/n[        UR                  5       5       H*  u  nu  pxUSU-  -  nUR!                  [#        U5      5        M,     [%        [#        U5      S-   5       V	V
s0 s H%  n	[%        [#        U5      5        H	  n
X4XZ   _M     M'     sn
n	U l        [%        [#        U5      S-   5       V	s0 s H  oU	S-  S-   _M     sn	U l        [%        [#        U5      S-   5       GHt  n	U	S:X  a:  U R                  R                  SS5        U R                  R                  SSS5        OAU R                  R                  SSX9S-
     -  5        U R                  R                  SSS5        U R                  R                  SUS-   5        U R                  R                  SSS5        [+        US U	 5      nU R-                  UR                  5       5      nU R/                  U5      nU R/                  U5      nUR1                  U5       H  nU R3                  XS5        M     X-
   H  nU R3                  XS5        M     X-
   H  nU R3                  XS5        M     GMw     U R                  R                  SS5        U R                  R                  SSS5        U R4                  R7                  SU R8                  R:                  SS5        g s  sn
n	f s  sn	f )NTrz  r{  normalr   r   Development Set (%d/%d)ri   r  z#Trace: waiting for a valid grammar.r  	z%s rn   r   zStart:
r  zend -2c linestartzend -2cz
Apply %s:
r   r  r  r  r  z
Finished.
r   g333333?)r  r  r  r  r  r   r   r   r  r   r   tag_addr   rulesr)  rJ  rG  r#  r$  charnumlinenumr   rI  _chunksintersection_color_chunkr   rD  r  r   )r   r   	gold_treer  tagseqr  wordnumro   posr4  jr   	test_treegold_chunkstest_chunkschunks                   r   r  RegexpChunkApp.show_trace  s\   "%/'"&.7#"*weU+#<"D$5$5$9$9$;<$
  <<NN!!%)NONN""7E59KK 1 12	""$ #$-i.>.>.@$A G[deck!FNN3v;' %B
 3u:>*
*3w<( FGJ( *

 /4CJN.CD.C1q519.CDs5zA~&AAv%%eZ8&&w0CYO%%e]Uq5\-IJ&&w0CYONN!!%$7NN""<1DiP'bq	2G(()9)9);<I,,y1K,,y1K$11+>!!!J7 ?$2!!!K8 3$2!!!K8 3) ', 	e]3w(;YG
 	sD//33Q<G

 Es   *,O8Oc                 l   SU R                   S'   U R                   R                  SS5        U R                   GH  u  p#nX!:X  Ga  UR                  SSR	                  S [        [        U R                  R                  5       5      S S	9 5       5      5      nU R                  U   R                  " S0 U R                  D6  U R                   R                  US
9  U R                   R                  SUS-   5        SnU R                   H  u  pgSU SU S3n[        R                  " X5       H  n	U R                   R!                  SXYR#                  S5      -  XYR%                  S5      -  5        U R                   R!                  SU-  XYR#                  S5      -  XYR%                  S5      -  5        U R                   R!                  SXYR#                  S5      -  XYR%                  S5      -  5        M     M     GM  U R                  U   R                  " S0 U R&                  D6  GM     SU R                   S'   g )Nr  r{  r   r   z
<<TAGSET>>r   c              3   ,   #    U  H
  nS U-  v   M     g7f)z	%s	%sN ).0items     r   	<genexpr>+RegexpChunkApp.show_help.<locals>.<genexpr>  s       %D #T)%   c                 n    [         R                  " SU S   5      =(       a    SU S   4=(       d    SU S   4$ )Nz\w+r   ri   )r   rh   )t_ws    r   r   *RegexpChunkApp.show_help.<locals>.<lambda>"  s8    BHHVSV,D -,!"CF-+ !3q6{-+r   )key)rz   z



















z1.0 + %d charsz(?s)(<z
>)(.*?)(</z>)rq  ri   rr  rn   r   rz  r  )r  r  r  replacejoinsortedlistr   itemsr  r   _HELPTAB_FG_PARAMSr   r  r   finditerr  startr   _HELPTAB_BG_PARAMS)
r   ro  namer  r  Cr-  r  patternms
             r   rn  RegexpChunkApp.show_help  s    (WE5)$(II DD{|| II $* !2!2!45!+%  d#**ET-D-DE###2##E4)+;<$#'#4#4KC &se:cU"=G[[7,,Wa''!*na%%PQ(lS,,$sNA
NAaL ,,Wa''!*na%%PQ(lS 8 $5 d#**ET-D-DE9 %.: !+Wr   c                 @    U R                  U R                  S-
  5        gNri   r  _view_historyr   r  s     r   r  RegexpChunkApp._history_prev9      4..23r   c                 @    U R                  U R                  S-   5        gr  r  r  s     r   r  RegexpChunkApp._history_next=  r  r   c                 \   [        S[        [        U R                  5      S-
  U5      5      nU R                  (       d  g XR                  :X  a  g SU R
                  S'   U R
                  R                  SS5        U R
                  R                  SU R                  U   S   5        U R
                  R                  SS5        Xl        U R                  U R                  U   S   5        U R                  U R                  U   S   5      U l        U R                  (       a@  U R                  R                  S5       Vs/ s H  n[        R                  " U5      PM     nnO/ n[        U5      U l        U R#                  5         U R%                  5         U R&                  (       a  U R)                  5         U R                  [        U R                  5      S-
  :  a@  S	R+                  U R                  S-   [        U R                  5      5      U R,                  S
'   g SU R,                  S
'   g s  snf )Nr   ri   r  r{  r   r   r   r   zGrammar {}/{}:r  r`  )r'  r%  r#  r   r   r   r  r   r   _syntax_highlight_grammarr   r   splitr   
fromstringr   r   r   _highlight_devsetr  r  formatr  )r   indexliner  s       r   r  RegexpChunkApp._view_historyA  s   As3t}}-159:}}''' $, ue,udmmE&:1&=>  51#&&t}}U';A'>?"&"8"8u9Ma9P"Q"" !3399$??D  **40?  E
 E(/ OOT]]!3a!77(8(?(?##a'DMM")Df%
 )3Df%)s   = H)c                 *    U R                  SSS5        g)Nscrollri   pager  r  r  s     r   r   RegexpChunkApp._devset_nextj  s    Ha0r   c                 *    U R                  SSS5        g)Nr  r   r  r  r  r  s     r   r   RegexpChunkApp._devset_prevn  s    Hb&1r   c                 b    U R                   c  g U R                   R                  5         S U l         g r   )r   r   r  s     r   r   RegexpChunkApp.destroyr  s&    88r   c                 (   SnU R                   nUS:X  aD  US   R                  S5      (       a+  U R                  U R                  [	        US   5      -   5        OUS:X  aG  US   R                  S5      (       a.  U R                  U R                  U[	        US   5      -  -   5        OUUS:X  aB  U R                  [	        [        US   5      U R                  R                  5       -  5      5        O SU SU 35       eU(       a  U R                  5         g g )	Nri   r  unitr   r  movetozbad scroll command r   )	r  
startswithr   r   r   floatr   r   r  )r   r   argsNshowing_traces        r   r  RegexpChunkApp._devset_scrollx  s    ++h47#5#5f#=#=T..T!W=> T!W%7%7%?%?T..Sa\1AAB StAw$2C2C2G2G2I!IJK<+G9AdV<<1OO r   c                    Uc  U R                   n[        [        SU5      U R                  R	                  5       S-
  5      nXR                   :X  a  U R
                  (       d  g Xl         SU l        SU R                  S'   SU R                  S'   SU R                  S'   SU R                  S'   U R                  R                  S	S
5        SU R                   S-   U R                  R	                  5       4-  U R                  S'   U R                  U R                   U R                   S-    n0 U l        SS0U l        [        U5       H  u  p4Sn[        UR                  5       5       HG  u  nu  px[!        U5      U R                  X64'   XW SU S3-  n[!        U5      U R                  X6S-   4'   MI     U R                  R#                  S
US S S-   5        M     U R$                  b  U R'                  5         SU R                  S'   U R                   U R                  R	                  5       -  n	U R                   S-   U R                  R	                  5       -  n
U R(                  R+                  X5        g )Nr   ri   Fr  r{  rz  ro   rv   r   r   r  r  r@  /r   r   z

rn   )r   r%  r'  r   r   r  r  r  r  r  r  r   r  r  r)  rJ  r#  r   r   r  r  r   )r   r  samplesentnumsentlinestrr  ro   r  firstlasts              r   r   RegexpChunkApp.show_devset  s3   =%%E C5M4#4#4#8#8#:Q#>?%%%d.A.A!#%-'"&07# #+w!'veU+#<"D$5$5$9$9$;<$
 
 T..1B1BQ1FG1v&v.MGG(1$++-(@$$14WW-.V1SE++58\Wk12 )A NN!!%")>? / <<#""$",w !!D$5$5$9$9$;;!!A%):):)>)>)@@u+r   c                     [        5       nSnU Hi  n[        U[        5      (       aL  UR                  5       U R                  :X  a  UR                  X3[        U5      -   45        U[        U5      -  nMd  US-  nMk     U$ )Nr   ri   )r   
isinstancer   r   r   addr#  )r   treechunksr  childs        r   r  RegexpChunkApp._chunks  so    E%&&;;=D$5$55JJ3u:)=>?3u:%1  r   c                    U R                   c  g U R                  R                  SSS5        U R                  R                  SSS5        U R                  R                  SSS5        U R                  R                  SSS5        [	        UR                  S5      5       GHa  u  p#UR                  5       (       d  M  [        R                  " SU5      nS nUR                  S	5      (       a_  UR                  S	5      nS
US-   UR                  S	5      4-  nS
US-   UR                  S	5      4-  nU R                  R                  SXg5        [        R                  " SU5       H  nUb  UR                  5       U:  a    M  S
US-   UR                  5       4-  nS
US-   UR                  5       4-  nUR                  5       S;   a  U R                  R                  SXg5        M  U R                  R                  SXg5        M     GMd     g )Nr  r   r   r  r  rd   r   z(\\.|[^#])*(#.*)?rn   z%d.%dri   z[<>{}]z<>)r   r   
tag_remover  r)  r  r   r   rh   groupr  r   r  )r   r   linenor  r  comment_startr  r   s           r   r  (RegexpChunkApp._syntax_highlight_grammar  s   88""9eU;""7E59""7E59eU;%gmmD&9:LF::<<-t4A Mwwqzz !
vz1771:66vz155844''	18[[40 ,m1Kvz177955vz155733779$OO++GQ:OO++GQ: 1 ;r   c           	         U R                   c  g U R                  R                  SSS5        / U l        [	        UR                  S5      5       HM  u  p#[        R                  " SSU5      nUR                  5       nU(       d  M6   [        R                  " U5        MO     S
U R                  S'   g ! [         a4  nU R                  R                  SSUS-   -  S	US-   -  5         S nAM  S nAff = f)Nr  r   r   r   r   r   z%s.0ri   z%s.0 lineendr@  r  )r   r   r  _grammarcheck_errsr)  r  r   r   r   r   r  r   r  r+  )r   r   r  r  r   s        r   _grammarcheckRegexpChunkApp._grammarcheck  s    88""7E59"$%gmmD&9:LF660%>D::<Dt#..t4 ; !F	 " OO++6A:!6&ST*8U s   B..
C,8)C''C,c                    U(       a  [         R                   " 5       U l        U R                  R                  SS5      =U l        nU R                  U5      nX0R                  :X  a  g X0l        U R                  [        U R                  5      S-
  :  a  SU R                  S'   U R                  U5         U(       a6  UR                  S5       Vs/ s H  n[        R                  " U5      PM     nnO/ n [%        U5      U l        U R                  R'                  SSS5        [         R                   " 5       U l        U R*                  (       a  U R-                  5         OU R/                  5         U R0                  (       d  U R3                  5         g g s  snf ! [         a"  nU R!                  U5        S U l         S nAg S nAff = f)Nr   r   ri   r`  r  r   r  )rB  r   r   r   r   r   r   r   r#  r   r  r  r  r   r  r   r   r   r   r  r   r  r  r  rA  rF  )r   eventr   r   r  r  r   s          r   r   RegexpChunkApp.update  sy   "&))+D "&!4!4UE!BBw "33G<!8!88&8# T]]!3a!77(2Df%&&w/	! !3 8 8 > > $..t4 >  
  )/""7E59#yy{OO""$'' (+  	w'DL		s0   3F  F-F 0F F 
G F;;G c                 v   Uc&  U R                   U R                  U R                  S-    nU R                  R                  SSS5        U R                  R                  SSS5        U R                  R                  SSS5        [	        U5       H  u  p#U R                  UR                  5       5      nU R                  U5      nU R                  U5      nUR                  U5       H  nU R                  X'S5        M     XV-
   H  nU R                  X'S5        M     Xe-
   H  nU R                  X'S5        M     M     g )Nri   r  r   r   r  r  )
r   r   r  r  r)  rI  rJ  r  r  r  )r   r
  r  r  r  r  r  r  s           r   r   RegexpChunkApp._highlight_devset  s   >[[!2!2T5F5F5JKF!!*eU;!!+ue<!!+ue< #,F"3G(()9)9);<I,,y1K,,y1K$11+>!!'*= ?$2!!'+> 3$2!!'+> 3 #4r   c                      U R                   R                  U5      $ ! [        [        4 a)  nU R                  R                  SSS5        Us S nA$ S nAff = f)Nr  r   r   )r   parser   
IndexErrorr   r  )r   wordsr   s      r   rI  RegexpChunkApp._chunkparse5  sN    	<<%%e,,J' 	 OO##GUE:L	s    AAAAc           	          Uu  pEU R                   R                  UU R                  U    SU R                  X4    3U R                  U    SU R                  X4   S-
   35        g )NrG   ri   )r  r  r  r  )r   r  r  r-  r  r   s         r   r  RegexpChunkApp._color_chunk@  sk    
||G$%Qt||GN'C&DE||G$%Qt||GL'AA'E&FG	
r   c                     S U l         S U l        S U l        SU l        / U l        SU l        U R                  R                  SS5        U R                  S5        U R                  5         g )Nr   r   r   )
r   r   r   r   r   r   r   r  r   r   )r   s    r   r   RegexpChunkApp.resetH  sZ    "& ue,r   z# Regexp Chunk Parsing Grammar
# Saved %(date)s
#
# Development set: %(devset)s
#   Precision: %(precision)s
#   Recall:    %(recall)s
#   F-score:   %(fscore)s

%(grammar)s
c                 2   U(       d  SS/n[        USS9nU(       d  g U R                  (       aL  U R                  U R                  U R                  S   S   5      :X  a  S U R                  S   SS   5       u  p4nOU R                  c  S	=n=pEOS
=n=pE[        US5       nUR                  U R                  [        [        R                  " 5       U R                  UUUU R                  R                  5       S9-  5        S S S 5        g ! , (       d  f       g = f)NzChunk Gramamr.chunkz	All files*r2  	filetypesdefaultextensionr   r   c              3   2   #    U  H  nS SU-  -  v   M     g7f)z%.2f%%r   Nr  )r  vs     r   r  .RegexpChunkApp.save_grammar.<locals>.<genexpr>j  s      ).CC!G$.Cs   ri   zGrammar not well formedzNot finished evaluation yetr
  )dater   r5  r6  r=  r   )r   r   r   r   r   openwriteSAVE_GRAMMAR_TEMPLATEdictrB  ctimer   r   r   )r   filenameftypesr5  r6  r=  outfiles          r   r   RegexpChunkApp.save_grammara  s   13EFF(6HUH==T448N8NMM"a 9
 
).2mmB.?.C)%Iv \\!*CCIC*GGIG(C GMM**++'!! LL..0
 !  s   A D
Dc                    U(       d  SS/n[        USS9nU(       d  g U R                  R                  SS5        U R                  5         [	        U5       nUR                  5       nS S S 5        [        R                  " SSW5      R                  5       nU R                  R                  SU5        U R                  5         g ! , (       d  f       Na= f)	Nr1  r3  r2  r5  r   r   z2^\# Regexp Chunk Parsing Grammar[\s\S]*F-score:.*
r@  )
r   r   r  r   r<  readr   r   lstripr   )r   rA  rB  infiler   s        r   r   RegexpChunkApp.load_grammar  s    13EFF&(SHue,(^vkkmG &&Er7

&( 	 	ug. ^s   C
Cc           	         U(       d  SS/n[        USS9nU(       d  g [        US5       nUR                  S5        UR                  S[        R                  " 5       -  5        UR                  SU R
                  -  5        [        U R                  5       H  u  nu  pVpxS	US
-   [        U R                  5      US-  US-  US-  4-  n	UR                  SU	-  5        UR                  SR                  S UR                  5       R                  5        5       5      5        M     U R                  (       a/  U R                  U R                  U R                  S   S   5      :X  d}  U R                  c  UR                  S5        OUR                  S5        UR                  SR                  S U R                  R                  5       R                  5        5       5      5        S S S 5        g ! , (       d  f       g = f)N)zChunk Gramamr History.txtr3  rK  r5  r
  z'# Regexp Chunk Parsing Grammar History
z# Saved %s
z# Development set: %s
z>Grammar %d/%d (precision=%.2f%%, recall=%.2f%%, fscore=%.2f%%)ri   r   z
%s
r@  c              3   ,   #    U  H
  nS U-  v   M     g7fz  %s
Nr  r  r  s     r   r  .RegexpChunkApp.save_history.<locals>.<genexpr>  s     %TBS$hoBSr  r   r   z#
Current Grammar (not well-formed)
z!
Current Grammar (not evaluated)
c              3   ,   #    U  H
  nS U-  v   M     g7frM  r  rN  s     r   r  rO    s     U8THtO8Tr  )r   r<  r=  rB  r@  r   r)  r   r#  r  r   r  r   r   r   r   )
r   rA  rB  rC  r4  rO  rP  rQ  rR  hdrs
             r   r   RegexpChunkApp.save_history  s   79KLF(6FSH(C GMMDEMM.4::<78MM3d6F6FFG#,T]]#;<A!%1uc$--0!c'1s7AGLM 
 hn-bgg%T!'')//BS%TTU $< ++))$--*;A*>?@ <<'MM"IJMM"GHGGU8J8J8L8R8R8TUU- !  s   F6G))
G7c                 |    SnSn SSK Jn  U" X#S9R                  5         g !   [        U R                  X25         g = f)Nz<NLTK RegExp Chunk Parser Application
Written by Edward Loperz2About: Regular Expression Chunk Parser Applicationr   )Message)messager   )tkinter.messageboxrT  showr   r   )r   r   ABOUTTITLErT  s        r   r   RegexpChunkApp.about  s:    TD	-2E/446	-TXXu,s   ! ;c                 $   Ub  U R                   R                  U5        U R                   R                  [        [        U R                  5      U R                   R                  5       5      5        U R                  S5        U R                  S5        g )Nri   r   )r   r   r%  r#  r   r   r   r   r~   s     r   r   RegexpChunkApp.set_devset_size  sk    !!$'c#dkk"2D4E4E4I4I4KLMr   c                     Ub  U R                   R                  U5        U R                   R                  5       nU R                  R	                  [        U5      * S9  U R                  R	                  [        S[        U5      * S-  S-  5      S9  g )N)r~   ir   r`   )r   r   r   r   r  absr   r%  r\  s     r   r   RegexpChunkApp.resize  so    JJNN4 zz~~

CI,/!!s3#d)r0AR0G'H!Ir   c                 \    [        5       (       a  gU R                  R                  " U0 UD6  g)z
Enter the Tkinter mainloop.  This function must be called if
this demo is created from a non-interactive program (e.g.
from a secript); otherwise, the demo will close as soon as
the script completes.
N)r   r   mainloop)r   r  kwargss      r   rb  RegexpChunkApp.mainloop  s%     994*6*r   ))rH  r"  r   r   rA  r   r   r,  r   r   r   r  r   r   r   r  r   r   r  r   r   r  r   r   r  r  r  r  r   r   r   r   r  r  r  r  r   r+  r   r   r  )r   Nr@  NPNr   )D__name__
__module____qualname____firstlineno____doc__r   r  r?  r  rC  rH  rE  rY  rX  r  r  r  r  _FONT_PARAMSr  r  r  _HELPTAB_BG_COLOR_HELPTAB_FG_COLORr  r  r  r   r   r   r   r   r   r&  _DRAW_LINESr   rA  rF  rM  r   r  r  rn  r  r  r  r   r   r   r  r   r  r  r   r   r  rI  r  r   r>  r   r   r   r   r   r   rb  __static_attributes__r  r   r   r   r   -   s   .(.$. 	. 	h	.
 	l. 	$. 	!. 	$. 	n. 	j. 	k. 	d. 	'. 	n. 	'.  	!." 	 #.$ 	!%.& 	g'.( 	~).* 	&+., 	&-.. 	+/.0 	&1.2 	$3.4 	5.6 	7.8 	l9.: 	";.< 	&=.> 	!?.@ 	{A.B 	C.D 	 E.F +,/400[.FneDP 
'(	$&)*	df-.	dT*+	td#$	4b12	tQ45	'(	46*+	$&)*L" K+ K#JCO O "	 "
O "
 VHQGN{5LF1EM"O FN 00O	  iV:
`$D HKE"N  IJV0{Jz N==~ +D'3R+,Z
;6!"1f?.	
	 < B-J	+r   r   c                  4    [        5       R                  5         g r   )r   rb  r  r   r   apprq    s    r   __main__rq  )'rj  randomr   textwraprB  tkinterr   r   r   r   r   r   r	   r
   r   r   tkinter.filedialogr   r   tkinter.fontr   
nltk.chunkr   r   nltk.chunk.regexpr   nltk.corpusr   r   nltk.draw.utilr   	nltk.treer   	nltk.utilr   r   rq  rf  __all__r  r   r   <module>r     sj     	     B  4 - 1 #  e+ e+P-  zE'r   