+
    ÖÇÜh •  ã                   óÖ   € R t ^ RIHtHtHt ^ RIHtHtHtH	t	H
t
Ht ^ RIHt ^ RIHt  ! R R]4      tR t]]3R lt ! R	 R
]4      t ! R R4      tR tR t]R8X  d
   ]! 4        R# R# )z
Graphically display a Tree.
)ÚIntVarÚMenuÚTk)Ú	BoxWidgetÚCanvasFrameÚCanvasWidgetÚ
OvalWidgetÚParenWidgetÚ
TextWidget)ÚTree)Úin_idlec                   óœ   a € ] tR t^t o RtR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tRtV tR# )ÚTreeSegmentWidgetaK  
A canvas widget that displays a single segment of a hierarchical
tree.  Each ``TreeSegmentWidget`` connects a single "node widget"
to a sequence of zero or more "subtree widgets".  By default, the
bottom of the node is connected to the top of each subtree by a
single line.  However, if the ``roof`` attribute is set, then a
single triangular "roof" will connect the node to all of its
children.

Attributes:
  - ``roof``: What sort of connection to draw between the node and
    its subtrees.  If ``roof`` is true, draw a single triangular
    "roof" over the subtrees.  If ``roof`` is false, draw a line
    between each subtree and the node.  Default value is false.
  - ``xspace``: The amount of horizontal space to leave between
    subtrees when managing this widget.  Default value is 10.
  - ``yspace``: The amount of space to place between the node and
    its children when managing this widget.  Default value is 15.
  - ``color``: The color of the lines connecting the node to its
    subtrees; and of the outline of the triangular roof.  Default
    value is ``'#006060'``.
  - ``fill``: The fill color for the triangular roof.  Default
    value is ``''`` (no fill).
  - ``width``: The width of the lines connecting the node to its
    subtrees; and of the outline of the triangular roof.  Default
    value is 1.
  - ``orientation``: Determines whether the tree branches downwards
    or rightwards.  Possible values are ``'horizontal'`` and
    ``'vertical'``.  The default value is ``'vertical'`` (i.e.,
    branch downwards).
  - ``draggable``: whether the widget can be dragged by the user.
c                óŠ  € W n         W0n        ^ V n        ^ V n        ^
V n        ^V n        RV n        V Uu. uF  qQP                  ^ ^ ^ ^ RR7      NK  	  upV n        VP                  ^ ^ RRRR7      V n
        V P                  V4       V F  pV P                  V4       K  	  RV n        \        P                  ! W3/ VB  R# u upi )z1
:type node:
:type subtrees: list(CanvasWidgetI)
Fú#006060©ÚfillÚ Úhidden)r   ÚstateÚoutlineN)Ú_labelÚ	_subtreesÚ_horizontalÚ_roofÚ_xspaceÚ_yspaceÚ_orderedÚcreate_lineÚ_linesÚcreate_polygonÚ_polygonÚ_add_child_widgetÚ	_managingr   Ú__init__)ÚselfÚcanvasÚlabelÚsubtreesÚattribsÚcÚsubtrees   &&&&,  Ú0/usr/lib/python3/dist-packages/nltk/draw/tree.pyr$   ÚTreeSegmentWidget.__init__@   sÎ   € ð
 ŒØ!Œð ˆÔØˆŒ
ØˆŒØˆŒØˆŒñ PXÓXÉxÈ!×)Ñ)¨!¨Q°°1¸9Ð)ÖEÉxÑXˆŒØ×-Ñ-Øˆq�r °9ð .ó 
ˆŒð
 	×Ñ˜uÔ%ÛˆGØ×"Ñ" 7Ö+ñ  ð ˆŒä×Ò˜dÑ6¨gÔ6ùò Ys   ´C c                óÖ  € V P                  4       pVR 8X  d£   W n        V P                  '       dF   V P                   F  pVP                  VRR7       K  	  VP                  V P                  RR7       R# V P                   F  pVP                  VRR7       K  	  VP                  V P                  RR7       R# VR8X  d,   VR8X  d
   ^V n        R# VR8X  d
   ^ V n        R# \        R4      hVR8X  dE   V P                   F  pVP                  WBR	7       K  	  VP                  V P                  VR
7       R# \        V\        4      '       dF   V^ ,          R8X  d8   V P                  \        V^,          4      ,          pVP                  WBR	7       R# VR8X  d    VP                  V P                  VR	7       R# VR8X  dF   VP                  V P                  W/4       V P                   F  pVP                  WAV/4       K  	  R# VR9   d9   VR8X  d   W n
        MVR8X  d   W n        V P                  V P                  4       R# VR8X  d	   W n        R# \        P                   ! WV4       R# )Úroofr   )r   ÚnormalÚorientationÚ
horizontalÚverticalz*orientation must be horizontal or verticalÚcolorr   )r   r   ÚwidthÚxspaceÚyspaceÚorderedN)r6   r7   )r&   r   r   Ú
itemconfigr!   r   Ú
ValueErrorÚ
isinstanceÚtupleÚintr   r   Úupdater   r   r   Ú__setitem__)r%   ÚattrÚvaluer&   Úls   &&&  r,   r?   ÚTreeSegmentWidget.__setitem___   sí  € Ø—‘“ˆØ�6Œ>ØŒJØ�z�zˆzØŸœ�AØ×%Ñ% a¨xÐ%Ö8ñ %à×!Ñ! $§-¡-°xÐ!Ö@àŸœ�AØ×%Ñ% a¨xÐ%Ö8ñ %à×!Ñ! $§-¡-°xÐ!Ö@Ø�]Ô"Ø˜Ô$Ø#$�Ö Ø˜*Ô$Ø#$�Ö ä Ð!MÓNÐNØ�WŒ_Ø—[”[�Ø×!Ñ! !Ð!Ö0ñ !à×Ñ˜dŸm™m°UÐÖ;Ü˜œe×$Ò$¨¨a­°GÔ);à—‘œC  Q¥›LÕ)ˆAØ×Ñ˜aÐÖ,Ø�VŒ^Ø×Ñ˜dŸm™m°%ÐÖ8Ø�WŒ_Ø×Ñ˜dŸm™m¨d¨]Ô;Ø—[”[�Ø×!Ñ! !¨E ]Ö3ó !àÐ)Ô)Ø�xÔØ$•Ø˜Ô!Ø$”Ø�K‰K˜Ÿ™Ö$Ø�YÔØ!ŽMä×$Ò$ T°Ö7ó    c                ó’  € VR 8X  d   V P                   # VR8X  d+   V P                  4       P                  V P                  V4      # VR8X  d+   V P                  4       P                  V P                  R4      # \	        V\
        4      '       dR   V^ ,          R8X  dD   V P                  \        V^,          4      ,          pV P                  4       P                  VR4      # VR8X  d   V P                  # VR8X  d   V P                  # VR8X  d   V P                  '       d   R# R	# VR
8X  d   V P                  # \        P                  ! W4      # )r/   r5   r4   r   r   r6   r7   r1   r2   r3   r8   )r   r&   Úitemcgetr!   r;   r<   r   r=   r   r   r   r   r   Ú__getitem__)r%   r@   rB   s   && r,   rG   ÚTreeSegmentWidget.__getitem__‹   s  € Ø�6Œ>Ø—:‘:ÐØ�WŒ_Ø—;‘;“=×)Ñ)¨$¯-©-¸Ó>Ð>Ø�WŒ_Ø—;‘;“=×)Ñ)¨$¯-©-¸ÓCÐCÜ˜œe×$Ò$¨¨a­°GÔ);Ø—‘œC  Q¥›LÕ)ˆAØ—;‘;“=×)Ñ)¨!¨VÓ4Ð4Ø�XÔØ—<‘<ÐØ�XÔØ—<‘<ÐØ�]Ô"Ø××ÐÙ#á!Ø�YÔØ—=‘=Ð ä×+Ò+¨DÓ7Ð7rD   c                ó   € V P                   # ©N)r   ©r%   s   &r,   r'   ÚTreeSegmentWidget.label£   s   € Ø�{‰{ÐrD   c                ó(   € V P                   R ,          # ):NNN)r   rK   s   &r,   r(   ÚTreeSegmentWidget.subtrees¦   s   € Ø�~‰~˜aÕ Ð rD   c                ó    € V P                  V P                  4       V P                  V4       Wn        V P                  V P                  4       R# )z"
Set the node label to ``label``.
N)Ú_remove_child_widgetr   r"   r>   )r%   r'   s   &&r,   Ú	set_labelÚTreeSegmentWidget.set_label©   s9   € ð 	×!Ñ! $§+¡+Ô.Ø×Ñ˜uÔ%ØŒØ�‰�D—K‘KÖ rD   c                ó¾   € V P                   P                  V4      pW P                   V&   V P                  V4       V P                  V4       V P	                  V4       R# )z3
Replace the child ``oldchild`` with ``newchild``.
N)r   ÚindexrP   r"   r>   )r%   ÚoldchildÚnewchildrT   s   &&& r,   Úreplace_childÚTreeSegmentWidget.replace_child²   sL   € ð —‘×$Ñ$ XÓ.ˆØ (�‰�uÑØ×!Ñ! (Ô+Ø×Ñ˜xÔ(Ø�‰�HÖrD   c                ó  € V P                   P                  V4      pV P                   V V P                  V4       V P                  4       P	                  V P
                  P                  4       4       V P                  V P                  4       R # rJ   )	r   rT   rP   r&   Údeleter   Úpopr>   r   )r%   ÚchildrT   s   && r,   Úremove_childÚTreeSegmentWidget.remove_child¼   s_   € Ø—‘×$Ñ$ UÓ+ˆØ�N‰N˜5Ð!Ø×!Ñ! %Ô(Ø�‰‹×Ñ˜TŸ[™[Ÿ_™_Ó.Ô/Ø�‰�D—K‘KÖ rD   c           
     ó  € V P                  4       pV P                  P                  W4       V P                  V4       V P                  P                  VP                  ^ ^ ^ ^ RR7      4       V P                  V P                  4       R# )é    r   r   N)	r&   r   Úinsertr"   r   Úappendr   r>   r   )r%   rT   r\   r&   s   &&& r,   Úinsert_childÚTreeSegmentWidget.insert_childÃ   se   € Ø—‘“ˆØ�‰×Ñ˜eÔ+Ø×Ñ˜uÔ%Ø�‰×Ñ˜6×-Ñ-¨a°°A°q¸yÐ-ÓIÔJØ�‰�D—K‘KÖ rD   c                óX   € V P                   '       d   V P                  .# V P                  # rJ   )r   r!   r   rK   s   &r,   Ú_tagsÚTreeSegmentWidget._tagsÌ   s!   € Ø�:�:ˆ:Ø—M‘M�?Ð"à—;‘;ÐrD   c                óL  € \        V\        4      '       d    VP                  4       P                  4       pMVP                  4       pV P                  '       d(   V^ ,          V^,          V^,          ,           R,          3# V^ ,          V^,          ,           R,          V^,          3# )r`   ç       @)r;   r   r'   Úbboxr   )r%   r\   rj   s   && r,   Ú_subtree_topÚTreeSegmentWidget._subtree_topÒ   s}   € Ü�eÔ.×/Ò/Ø—;‘;“=×%Ñ%Ó'‰Dà—:‘:“<ˆDØ××ÐØ˜•G˜d 1�g¨¨Q­Õ/°3Õ6Ð7Ð7à˜!•W˜t A�wÕ&¨#Õ-¨t°A­wÐ7Ð7rD   c                óö   € V P                   P                  4       pV P                  '       d(   V^,          V^,          V^,          ,           R,          3# V^ ,          V^,          ,           R,          V^,          3# )é   ri   )r   rj   r   )r%   rj   s   & r,   Ú_node_bottomÚTreeSegmentWidget._node_bottomÜ   sb   € Ø�{‰{×ÑÓ!ˆØ××ÐØ˜•G˜d 1�g¨¨Q­Õ/°3Õ6Ð7Ð7à˜!•W˜t A�wÕ&¨#Õ-¨t°A­wÐ7Ð7rD   c                óB  € \        V P                  4      ^ 8X  d   R# V P                  P                  4       f   R# WP                  J d   V P                  pMV.pV P                  '       d$   V P
                  '       g   V P                  V4      pV P                  4       w  r4V P                  ^ ,          P                  4       w  rVrxV P                  R,           F[  p	V	P                  4       p
\        WZ^ ,          4      p\        Wj^,          4      p\        Wz^,          4      p\        WŠ^,          4      pK]  	  V P                  '       d/   V P                  4       P                  V P                  W4WVWXW44	       M-V P                  4       P                  V P                  W4WVWvW44	       V Fu  p	V P                  4       w  r4V P                  V P                  P                  V	4      ,          pV P!                  V	4      w  rÍV P                  4       P                  W³WLV4       Kw  	  R# )r`   N:é   NN)Úlenr   r   rj   r   r#   Ú_maintain_orderro   ÚminÚmaxr   r&   Úcoordsr!   r   rT   rk   )r%   r\   Úneed_updateÚnodexÚnodeyÚxminÚyminÚxmaxÚymaxr+   rj   ÚlineÚsubtreexÚsubtreeys   &&            r,   Ú_updateÚTreeSegmentWidget._updateã   sª  € Üˆt�~‰~Ó !Ô#ÙØ�;‰;×ÑÓÒ%Ùð —K‘KÓØŸ.™.‰Kà ˜'ˆKà�=�=ˆ= §§ Ø×.Ñ.¨uÓ5ˆKð ×*Ñ*Ó,‰ˆØ#'§>¡>°!Õ#4×#9Ñ#9Ó#;Ñ ˆ�TØ—~‘~ b×)Ð)ˆGØ—<‘<“>ˆDÜ�t !�WÓ%ˆDÜ�t !�WÓ%ˆDÜ�t !�WÓ%ˆDÜ�t !�WÓ%ŠDñ *ð ××ÐØ�K‰K‹M× Ñ Ø—‘˜u¨T¸ÀUõð �K‰K‹M× Ñ Ø—‘˜u¨T¸ÀUôó
 #ˆGØ!×.Ñ.Ó0‰NˆUØ—;‘;˜tŸ~™~×3Ñ3°GÓ<Õ=ˆDØ#'×#4Ñ#4°WÓ#=Ñ ˆXØ�K‰K‹M× Ñ  ¨e¸xÖHó	 #rD   c                ój   € V P                   '       d   V P                  V4      # V P                  V4      # rJ   )r   Ú_maintain_order_horizontalÚ_maintain_order_vertical)r%   r\   s   &&r,   rt   Ú!TreeSegmentWidget._maintain_order  s0   € Ø××ÐØ×2Ñ2°5Ó9Ð9à×0Ñ0°Ó7Ð7rD   c                óˆ  € VP                  4       w  r#rEWP                  J du   V P                   FX  pVP                  4       w  rxršWPP                  ,           V8”  g   K/  VP	                  ^ WPP                  ,           V,
          4       KZ  	  V P                  # V.pV P                  P                  V4      pW@P                  ,           p\        V^,           \        V P                  4      4       Fš  pV P                  V,          P                  4       w  rxršW×8”  g   K/  V P                  V,          P	                  W×,
          ^ 4       WÙV,
          V P                  ,           ,          pVP                  V P                  V,          4       Kœ  	  W P                  ,
          p\        V^,
          RR4       Fš  pV P                  V,          P                  4       w  rxršWÙ8  g   K/  V P                  V,          P	                  WÙ,
          ^ 4       WÙV,
          V P                  ,           ,          pVP                  V P                  V,          4       Kœ  	  V P                  P                  4       w  rxršW£V P                  ,
          8”  d@   V P                  P	                  ^ W0P                  ,
          V
,
          4       V P                  pV# )r`   éÿÿÿÿ)
rj   r   r   r   ÚmoverT   r   Úrangers   rb   )r%   r\   ÚleftÚtopÚrightÚbotr+   Úx1Úy1Úx2Úy2ÚmovedrT   ÚxÚis   &&             r,   r†   Ú*TreeSegmentWidget._maintain_order_vertical  sÿ  € Ø"'§*¡*£,Ñˆ�Eà—K‘KÓàŸ>œ>�Ø#*§<¡<£>Ñ �˜ØŸ™Õ%¨Ö*Ø—L‘L  C¯,©,Õ$6¸Õ$;Ö<ñ *ð
 —>‘>Ð!à�GˆEØ—N‘N×(Ñ(¨Ó/ˆEð Ÿ™Õ$ˆAÜ˜5 1�9¤c¨$¯.©.Ó&9Ö:�Ø#'§>¡>°!Õ#4×#9Ñ#9Ó#;Ñ �˜Ø–6Ø—N‘N 1Õ%×*Ñ*¨1­6°1Ô5Ø˜b� 4§<¡<Õ/Õ/�AØ—L‘L §¡°Õ!2Ö3ñ ;ð —|‘|Õ#ˆAÜ˜5 1�9 b¨"Ö-�Ø#'§>¡>°!Õ#4×#9Ñ#9Ó#;Ñ �˜Ø–6Ø—N‘N 1Õ%×*Ñ*¨1­6°1Ô5Ø˜b� 4§<¡<Õ/Õ/�AØ—L‘L §¡°Õ!2Ö3ñ .ð  $Ÿ{™{×/Ñ/Ó1ÑˆR�RØ˜$Ÿ,™,Õ&Ô&Ø—‘× Ñ   C¯,©,Õ$6¸Õ$;Ô<ØŸ™�ð ˆrD   c                ó†  € VP                  4       w  r#rEWP                  J dt   V P                   FW  pVP                  4       w  rxršW@P                  ,           V8”  g   K/  VP	                  W@P                  ,           V,
          4       KY  	  V P                  # V.pV P                  P                  V4      pWPP                  ,           p\        V^,           \        V P                  4      4       Fš  pV P                  V,          P                  4       w  rxršWØ8”  g   K/  V P                  V,          P	                  ^ WØ,
          4       WÚV,
          V P                  ,           ,          pVP                  V P                  V,          4       Kœ  	  W0P                  ,
          p\        V^,
          RR4       Fš  pV P                  V,          P                  4       w  rxršWÚ8  g   K/  V P                  V,          P	                  ^ WÚ,
          4       WÚV,
          V P                  ,           ,          pVP                  V P                  V,          4       Kœ  	  V P                  P                  4       w  rxršW’V P                  ,
          8”  d@   V P                  P	                  W P                  ,
          V	,
          ^ 4       V P                  pV# )rr   r‰   )
rj   r   r   r   rŠ   rT   r   r‹   rs   rb   )r%   r\   rŒ   r�   rŽ   r�   r+   r�   r‘   r’   r“   r”   rT   Úyr–   s   &&             r,   r…   Ú,TreeSegmentWidget._maintain_order_horizontal<  sý  € Ø"'§*¡*£,Ñˆ�Eà—K‘KÓàŸ>œ>�Ø#*§<¡<£>Ñ �˜ØŸ<™<Õ'¨"Ö,Ø—L‘L ¯©Õ!5¸Õ!:Ö;ñ *ð
 —>‘>Ð!à�GˆEØ—N‘N×(Ñ(¨Ó/ˆEð —l‘lÕ"ˆAÜ˜5 1�9¤c¨$¯.©.Ó&9Ö:�Ø#'§>¡>°!Õ#4×#9Ñ#9Ó#;Ñ �˜Ø–6Ø—N‘N 1Õ%×*Ñ*¨1¨a­fÔ5Ø˜b� 4§<¡<Õ/Õ/�AØ—L‘L §¡°Õ!2Ö3ñ ;ð —l‘lÕ"ˆAÜ˜5 1�9 b¨"Ö-�Ø#'§>¡>°!Õ#4×#9Ñ#9Ó#;Ñ �˜Ø–6Ø—N‘N 1Õ%×*Ñ*¨1¨a­fÔ5Ø˜b� 4§<¡<Õ/Õ/�AØ—L‘L §¡°Õ!2Ö3ñ .ð  $Ÿ{™{×/Ñ/Ó1ÑˆR�RØ˜4Ÿ<™<Õ'Ô'Ø—‘× Ñ  ¯©Õ!4°rÕ!9¸1Ô=ØŸ™�ð ˆrD   c                óD  € V P                  4       w  r^pV P                   F�  pVP                  4       pW^ ,          ,
          V P                  ,           pW5^,          ,
          pVP	                  Wg4       W5^,          V^,          ,
          V P
                  ,           ,          pKƒ  	  RpV P                   F!  pW€P                  V4      ^,          ,          pK#  	  V\        V P                  4      ,          pV P                   F  pVP	                  ^ W(,
          4       K  	  R# )é   ç        N)ro   r   rj   r   rŠ   r   rk   rs   )	r%   ry   rz   r™   r+   Úsubtree_bboxÚdxÚdyÚcenters	   &        r,   Ú_manage_horizontalÚ$TreeSegmentWidget._manage_horizontalf  sÝ   € Ø×*Ñ*Ó,‰ˆð ˆØ—~”~ˆGØ"Ÿ<™<›>ˆLØ a�Õ(¨4¯<©<Õ7ˆBØ !•_Õ$ˆBØ�L‰L˜Ô Ø˜a• <°¥?Õ2°T·\±\ÕAÕAŠAñ &ð ˆØ—~”~ˆGØ×'Ñ'¨Ó0°Õ3Õ3ŠFñ &à”#�d—n‘nÓ%Õ%ˆð —~”~ˆGØ�L‰L˜˜E�NÖ+ó &rD   c                ó@  € V P                  4       w  r^ pV P                   F�  pVP                  4       pW%^,          ,
          V P                  ,           pW5^ ,          ,
          pVP	                  Wv4       W5^,          V^ ,          ,
          V P
                  ,           ,          pKƒ  	  RpV P                   F;  pW€P                  V4      ^ ,          \        V P                  4      ,          ,          pK=  	  V P                   F  pVP	                  W,
          ^ 4       K  	  R# )r`   r�   N)ro   r   rj   r   rŠ   r   rk   rs   )	r%   ry   rz   r•   r+   rž   r    rŸ   r¡   s	   &        r,   Ú_manage_verticalÚ"TreeSegmentWidget._manage_vertical|  sØ   € Ø×*Ñ*Ó,‰ˆð ˆØ—~”~ˆGØ"Ÿ<™<›>ˆLØ a�Õ(¨4¯<©<Õ7ˆBØ !•_Õ$ˆBØ�L‰L˜Ô Ø˜a• <°¥?Õ2°T·\±\ÕAÕAŠAñ &ð ˆØ—~”~ˆGØ×'Ñ'¨Ó0°Õ3´c¸$¿.¹.Ó6IÕIÕIŠFñ &ð —~”~ˆGØ�L‰L˜�¨Ö+ó &rD   c                ó,  € R V n         V P                  4       w  r\        V P                  4      ^ 8X  d   R# V P                  '       d   V P                  4        MV P                  4        V P                   F  pV P                  V4       K  	  RV n         R# )TNF)r#   ro   rs   r   r   r¢   r¥   r‚   )r%   ry   rz   r+   s   &   r,   Ú_manageÚTreeSegmentWidget._manage‘  sv   € ØˆŒØ×*Ñ*Ó,‰ˆÜˆt�~‰~Ó !Ô#Ùà××ÐØ×#Ñ#Õ%à×!Ñ!Ô#ð —~”~ˆGØ�L‰L˜Ö!ñ &ð ˆŽrD   c                ó<   € R V P                    RV P                   R2# )z	[TreeSeg z: Ú])r   r   rK   s   &r,   Ú__repr__ÚTreeSegmentWidget.__repr__¢  s    € Ø˜4Ÿ;™;˜- r¨$¯.©.Ð)9¸Ð;Ð;rD   )
r   r   r   r#   r   r!   r   r   r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r$   r?   rG   r'   r(   rQ   rW   r]   rc   rf   rk   ro   r‚   rt   r†   r…   r¢   r¥   r¨   r¬   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r,   r   r      sy   ø‡ € ñòB7ò>*8òX8ò0ò!ò!òò!ò!òò8ò8ò'IòR8ò(òT(òT,ò,,ò*÷"<ð <rD   r   c                 óÔ   € \        V\        4      '       dF   V! WP                  4       3/ VB pV U	u. uF  p	\        V V	VVVVVV4      NK  	  p
p	\	        WV
3/ VB # V! W3/ VB # u up	i rJ   )r;   r   r'   Ú_tree_to_treesegr   )r&   ÚtÚ	make_nodeÚ	make_leafÚtree_attribsÚnode_attribsÚleaf_attribsÚloc_attribsr'   r\   r(   s   &&&&&&&&   r,   r¸   r¸   ¦  s’   € ô �!”T×ÒÙ˜&§'¡'£)Ñ<¨|Ñ<ˆñ ó
ñ �ô ØØØØØØØØö	ñ ð 	ð 
ô ! °ÑI¸LÑIÐIá˜Ñ3 lÑ3Ð3ùò
s   ²A%c           
     ór  € / p/ p/ p/ p\        VP                  4       4       F�  w  ršV	R,          R8X  d   W¥V	R,          &   K   V	R,          R8X  d   W¦V	R,          &   K;  V	R,          R8X  d   W§V	R,          &   KV  V	R,          R8X  d   W¨V	R,          &   Kq  \        R	V	,          4      h	  \        V VVVVVVV4      # )
a  
Convert a Tree into a ``TreeSegmentWidget``.

:param make_node: A ``CanvasWidget`` constructor or a function that
    creates ``CanvasWidgets``.  ``make_node`` is used to convert
    the Tree's nodes into ``CanvasWidgets``.  If no constructor
    is specified, then ``TextWidget`` will be used.
:param make_leaf: A ``CanvasWidget`` constructor or a function that
    creates ``CanvasWidgets``.  ``make_leaf`` is used to convert
    the Tree's leafs into ``CanvasWidgets``.  If no constructor
    is specified, then ``TextWidget`` will be used.
:param attribs: Attributes for the canvas widgets that make up the
    returned ``TreeSegmentWidget``.  Any attribute beginning with
    ``'tree_'`` will be passed to all ``TreeSegmentWidgets`` (with
    the ``'tree_'`` prefix removed.  Any attribute beginning with
    ``'node_'`` will be passed to all nodes.  Any attribute
    beginning with ``'leaf_'`` will be passed to all leaves.  And
    any attribute beginning with ``'loc_'`` will be passed to all
    text locations (for Trees).
ºNé   NÚtree_ºrÂ   NNÚnode_Úleaf_ºNé   NÚloc_ºrÈ   NNzBad attribute: %s)ÚlistÚitemsr:   r¸   )r&   r¹   rº   r»   r)   r¼   r½   r¾   r¿   ÚkeyrA   s   &&&&,      r,   Útree_to_treesegmentrÎ   Ä  sÇ   € ð0 €LØ€LØ€LØ€Kä˜7Ÿ=™=›?Ö+‰
ˆØˆr�7�gÔØ$)˜˜R�Ó!Ø��W˜ÔØ$)˜˜R�Ó!Ø��W˜ÔØ$)˜˜R�Ó!Ø��W˜ÔØ#(˜˜B�Ó äÐ0°3Õ6Ó7Ð7ñ ,ô ØØ	ØØØØØØó	ð 	rD   c                   ó¤   a € ] tR tRt o Rt]]3R ltR tR tRR lt	RR lt
RR ltRR	 ltRR
 ltRR ltR tR tR tR tR tR tR tRtV tR# )Ú
TreeWidgetiý  a   
A canvas widget that displays a single Tree.
``TreeWidget`` manages a group of ``TreeSegmentWidgets`` that are
used to display a Tree.

Attributes:

  - ``node_attr``: Sets the attribute ``attr`` on all of the
    node widgets for this ``TreeWidget``.
  - ``node_attr``: Sets the attribute ``attr`` on all of the
    leaf widgets for this ``TreeWidget``.
  - ``loc_attr``: Sets the attribute ``attr`` on all of the
    location widgets for this ``TreeWidget`` (if it was built from
    a Tree).  Note that a location widget is a ``TextWidget``.

  - ``xspace``: The amount of horizontal space to leave between
    subtrees when managing this widget.  Default value is 10.
  - ``yspace``: The amount of space to place between the node and
    its children when managing this widget.  Default value is 15.

  - ``line_color``: The color of the lines connecting each expanded
    node to its subtrees.
  - ``roof_color``: The color of the outline of the triangular roof
    for collapsed trees.
  - ``roof_fill``: The fill color for the triangular roof for
    collapsed trees.
  - ``width``

  - ``orientation``: Determines whether the tree branches downwards
    or rightwards.  Possible values are ``'horizontal'`` and
    ``'vertical'``.  The default value is ``'vertical'`` (i.e.,
    branch downwards).

  - ``shapeable``: whether the subtrees can be independently
    dragged by the user.  THIS property simply sets the
    ``DRAGGABLE`` property on all of the ``TreeWidget``'s tree
    segments.
  - ``draggable``: whether the widget can be dragged by the user.
c                óÒ  € W0n         W@n        W n        / V n        / V n        R R/V n        RV n        ^V n        RV n        RV n	        RV n
        ^
V n        ^
V n        RV n        RV n        / V n        / V n        / V n        . V n        . V n        V P)                  WR4       V P+                  WR4      V n        V P/                  V P,                  4       \0        P2                  ! W3/ VB  R# )r4   z#008000z#008080z#c0c0c0Fr3   N© )Ú
_make_nodeÚ
_make_leafÚ_treeÚ_nodeattribsÚ_leafattribsÚ_locattribsÚ_line_colorÚ_line_widthÚ_roof_colorÚ
_roof_fillÚ
_shapeabler   r   Ú_orientationr   Ú_keysÚ_expanded_treesÚ_collapsed_treesÚ_nodesÚ_leavesÚ_make_collapsed_treesÚ_make_expanded_treeÚ_treesegr"   r   r$   )r%   r&   r¹   rº   r»   r)   s   &&&&&,r,   r$   ÚTreeWidget.__init__&  så   € ð $ŒØ#ŒØŒ
ð ˆÔØˆÔØ# YÐ/ˆÔØ$ˆÔØˆÔØ$ˆÔØ#ˆŒØˆŒØˆŒØˆŒØ&ˆÔØˆŒð ˆŒ
Ø!ˆÔØ "ˆÔØˆŒØˆŒà×"Ñ" 6¨bÔ1Ø×0Ñ0°¸BÓ?ˆŒØ×Ñ˜tŸ}™}Ô-ä×Ò˜dÑ6¨gÔ6rD   c                ó(   € V P                   V,          # ©a  
Return the ``TreeSegmentWidget`` for the specified subtree.

:param path_to_tree: A list of indices i1, i2, ..., in, where
    the desired widget is the widget corresponding to
    ``tree.children()[i1].children()[i2]....children()[in]``.
    For the root, the path is ``()``.
)rà   ©r%   Úpath_to_trees   &*r,   Úexpanded_treeÚTreeWidget.expanded_treeI  s   € ð ×#Ñ# LÕ1Ð1rD   c                ó(   € V P                   V,          # ré   )rá   rê   s   &*r,   Úcollapsed_treeÚTreeWidget.collapsed_treeT  s   € ð ×$Ñ$ \Õ2Ð2rD   c                óò   € \        V P                  P                  4       4       F  pVP                  W4       K  	  \        V P                  P                  4       4       F  pVP                  W4       K  	  R# ©z%
Add a binding to all tree segments.
N)rË   rà   ÚvaluesÚ
bind_clickrá   ©r%   ÚcallbackÚbuttonÚtsegs   &&& r,   Úbind_click_treesÚTreeWidget.bind_click_trees_  sX   € ô ˜×-Ñ-×4Ñ4Ó6Ö7ˆDØ�O‰O˜HÖ-ñ 8ä˜×.Ñ.×5Ñ5Ó7Ö8ˆDØ�O‰O˜HÖ-ó 9rD   c                óò   € \        V P                  P                  4       4       F  pVP                  W4       K  	  \        V P                  P                  4       4       F  pVP                  W4       K  	  R# rò   )rË   rà   ró   Ú	bind_dragrá   rõ   s   &&& r,   Úbind_drag_treesÚTreeWidget.bind_drag_treesh  sX   € ô ˜×-Ñ-×4Ñ4Ó6Ö7ˆDØ�N‰N˜8Ö,ñ 8ä˜×.Ñ.×5Ñ5Ó7Ö8ˆDØ�N‰N˜8Ö,ó 9rD   c                ó–   € V P                    F  pVP                  W4       K  	  V P                    F  pVP                  W4       K  	  R# ©z
Add a binding to all leaves.
N)rã   rô   ©r%   rö   r÷   Úleafs   &&& r,   Úbind_click_leavesÚTreeWidget.bind_click_leavesq  s8   € ð —L”LˆDØ�O‰O˜HÖ-ñ !à—L”LˆDØ�O‰O˜HÖ-ó !rD   c                ó–   € V P                    F  pVP                  W4       K  	  V P                    F  pVP                  W4       K  	  R# r   )rã   rü   r  s   &&& r,   Úbind_drag_leavesÚTreeWidget.bind_drag_leavesz  s8   € ð —L”LˆDØ�N‰N˜8Ö,ñ !à—L”LˆDØ�N‰N˜8Ö,ó !rD   c                ó–   € V P                    F  pVP                  W4       K  	  V P                    F  pVP                  W4       K  	  R# ©z
Add a binding to all nodes.
N)râ   rô   ©r%   rö   r÷   Únodes   &&& r,   Úbind_click_nodesÚTreeWidget.bind_click_nodesƒ  s8   € ð —K”KˆDØ�O‰O˜HÖ-ñ  à—K”KˆDØ�O‰O˜HÖ-ó  rD   c                ó–   € V P                    F  pVP                  W4       K  	  V P                    F  pVP                  W4       K  	  R# r	  )râ   rü   r
  s   &&& r,   Úbind_drag_nodesÚTreeWidget.bind_drag_nodesŒ  s8   € ð —K”KˆDØ�N‰N˜8Ö,ñ  à—K”KˆDØ�N‰N˜8Ö,ó  rD   c           
     ó¨  € \        V\        4      '       g   R # V P                  pV P                  pV! WP	                  4       3/ V P
                  B pV P                  P                  V4       VP                  4        Uu. uF  qu! W3/ V P                  B NK  	  ppV ;P                  V,          un
        \        VVV^V P                  V P                  V P                  R7      p	W�P                  V&   W0P                   V	&   V	P#                  4        \%        \'        V4      4       F$  p
W*,          pV P)                  WW:3,           4       K&  	  R # u upi )N)r/   r4   r   r5   )r;   r   rÓ   rÔ   r'   rÖ   râ   rb   Úleavesr×   rã   r   rÛ   rÜ   rÚ   rá   rß   Úhider‹   rs   rä   )r%   r&   r¹   rÍ   rº   r»   r  rB   r  Útreesegr–   r\   s   &&&&        r,   rä   Ú TreeWidget._make_collapsed_trees•  s  € Ü˜!œT×"Ò"ÙØ—O‘Oˆ	Ø—O‘Oˆ	á˜§¡£Ñ@¨d×.?Ñ.?Ñ@ˆØ�‰×Ñ˜4Ô ØEFÇXÁXÄZÓPÁZÀ�)˜FÑ;¨×):Ñ):Ô;ÁZˆÐPØ�Š˜Õ�Ü#ØØØØØ×"Ñ"Ø—‘Ø×"Ñ"ô
ˆð &-×Ñ˜cÑ"Ø!�
‰
�7Ñà�‰Œô ”s˜1“v–ˆAØ•DˆEØ×&Ñ& v°c¸DµjÖAó ùò% Qs   Á?Ec           	     óF  € V P                   pV P                  p\        V\        4      '       dÀ   V! WP	                  4       3/ V P
                  B pV P                  P                  V4       Tp\        \        V4      4       Uu. uF#  pV P                  WV,          W83,           4      NK%  	  p	p\        WW�P                  V P                  R 7      p
W P                  V&   W0P                  V
&   V
# V! W3/ V P                   B pV P"                  P                  V4       V# u upi ))r4   r5   )rÓ   rÔ   r;   r   r'   rÖ   râ   rb   r‹   rs   rå   r   rÙ   rÚ   rà   rß   r×   rã   )r%   r&   r¹   rÍ   rº   r»   r  Úchildrenr–   r(   r  r  s   &&&&        r,   rå   ÚTreeWidget._make_expanded_tree³  s  € Ø—O‘Oˆ	Ø—O‘Oˆ	ä�aœ×ÒÙ˜V§W¡W£YÑD°$×2CÑ2CÑDˆDØ�K‰K×Ñ˜tÔ$ØˆHô œs 8›}Ô-óá-�Að ×(Ñ(¨¸!µ¸cÀD½jÖIÙ-ð ð ô (Ø˜h×.>Ñ.>Àd×FVÑFVôˆGð )0× Ñ  Ñ%Ø"%�J‰J�wÑØˆNá˜VÑ<¨$×*;Ñ*;Ñ<ˆDØ�L‰L×Ñ Ô%ØˆKùòs   Â)Dc                óì  € VR ,          R8X  d!   V P                    F  pW#VR,          &   K  	  R# VR ,          R8X  d!   V P                   F  pW$VR,          &   K  	  R# VR8X  d7   W n        \        V P                  P                  4       4       F  pW%R&   K	  	  R# VR8X  de   W n        \        V P                  P                  4       4       F  pW%R&   K	  	  \        V P                  P                  4       4       F  pW%R&   K	  	  R# VR8X  d7   W n        \        V P                  P                  4       4       F  pW%R&   K	  	  R# VR	8X  d7   W n	        \        V P                  P                  4       4       F  pW%R
&   K	  	  R# VR8X  d|   W n
        \        V P                  P                  4       4       F  pW%R&   K	  	  \        V P                  P                  4       4       F  pW%R&   K	  	  V P                   F  pW$R&   K	  	  R# VR8X  du   W n        \        V P                  P                  4       4       F  pW%R&   K	  	  \        V P                  P                  4       4       F  pW%R&   K	  	  V P                  4        R# VR8X  du   W n        \        V P                  P                  4       4       F  pW%R&   K	  	  \        V P                  P                  4       4       F  pW%R&   K	  	  V P                  4        R# VR8X  du   W n        \        V P                  P                  4       4       F  pW%R&   K	  	  \        V P                  P                  4       4       F  pW%R&   K	  	  V P                  4        R# VR8X  de   W n        \        V P                  P                  4       4       F  pW%R&   K	  	  \        V P                  P                  4       4       F  pW%R&   K	  	  R# \         P"                  ! WV4       R# )rÁ   rÅ   rÄ   rÆ   Ú
line_colorr4   Ú
line_widthr5   Ú
roof_colorÚ	roof_fillr   Ú	shapeableÚ	draggabler6   r7   r1   r8   N)râ   rã   rÙ   rË   rà   ró   rÚ   rá   rÛ   rÜ   rÝ   r   Úmanager   rÞ   r   r   r?   )r%   r@   rA   r  r  rø   s   &&&   r,   r?   ÚTreeWidget.__setitem__Ê  s7  € Ø��8�wÔØŸœ�Ø!&�T˜"•X“ó $à�"�X˜Ô ØŸœ�Ø!&�T˜"•X“ó %à�\Ô!Ø$ÔÜ˜T×1Ñ1×8Ñ8Ó:Ö;�Ø %�W“ó <à�\Ô!Ø$ÔÜ˜T×1Ñ1×8Ñ8Ó:Ö;�Ø %�W“ñ <ä˜T×2Ñ2×9Ñ9Ó;Ö<�Ø %�W“ó =à�\Ô!Ø$ÔÜ˜T×2Ñ2×9Ñ9Ó;Ö<�Ø %�W“ó =à�[Ô Ø#ŒOÜ˜T×2Ñ2×9Ñ9Ó;Ö<�Ø$�V“ó =à�[Ô Ø#ŒOÜ˜T×1Ñ1×8Ñ8Ó:Ö;�Ø$)�[Ó!ñ <ä˜T×2Ñ2×9Ñ9Ó;Ö<�Ø$)�[Ó!ñ =àŸœ�Ø$)�[Ó!ó %à�XÔØ ŒLÜ˜T×1Ñ1×8Ñ8Ó:Ö;�Ø!&�X“ñ <ä˜T×2Ñ2×9Ñ9Ó;Ö<�Ø!&�X“ñ =à�K‰KŽMØ�XÔØ ŒLÜ˜T×1Ñ1×8Ñ8Ó:Ö;�Ø!&�X“ñ <ä˜T×2Ñ2×9Ñ9Ó;Ö<�Ø!&�X“ñ =à�K‰KŽMØ�]Ô"Ø %ÔÜ˜T×1Ñ1×8Ñ8Ó:Ö;�Ø&+�]Ó#ñ <ä˜T×2Ñ2×9Ñ9Ó;Ö<�Ø&+�]Ó#ñ =à�K‰KŽMØ�YÔØ!ŒMÜ˜T×1Ñ1×8Ñ8Ó:Ö;�Ø"'�Y“ñ <ä˜T×2Ñ2×9Ñ9Ó;Ö<�Ø"'�Y“ó =ô ×$Ò$ T°Ö7rD   c                ó„  € VR ,          R8X  d$   V P                   P                  VR,          R4      # VR ,          R8X  d$   V P                  P                  VR,          R4      # VR,          R8X  d$   V P                  P                  VR,          R4      # VR8X  d   V P                  # VR	8X  d   V P
                  # VR
8X  d   V P                  # VR8X  d   V P                  # VR8X  d   V P                  # VR8X  d   V P                  # VR8X  d   V P                  # VR8X  d   V P                  # \        P                  ! W4      # )rÁ   rÅ   rÄ   NrÆ   rÇ   rÉ   rÊ   r  r  r  r  r  r6   r7   r1   )rÖ   Úgetr×   rØ   rÙ   rÚ   rÛ   rÜ   rÝ   r   r   rÞ   r   rG   )r%   r@   s   &&r,   rG   ÚTreeWidget.__getitem__	  s&  € Ø��8�wÔØ×$Ñ$×(Ñ(¨¨b­°4Ó8Ð8Ø�"�X˜Ô Ø×$Ñ$×(Ñ(¨¨b­°4Ó8Ð8Ø�"�X˜ÔØ×#Ñ#×'Ñ'¨¨R­°$Ó7Ð7Ø�\Ô!Ø×#Ñ#Ð#Ø�\Ô!Ø×#Ñ#Ð#Ø�\Ô!Ø×#Ñ#Ð#Ø�[Ô Ø—?‘?Ð"Ø�[Ô Ø—?‘?Ð"Ø�XÔØ—<‘<ÐØ�XÔØ—<‘<ÐØ�]Ô"Ø×$Ñ$Ð$ä×+Ò+¨DÓ7Ð7rD   c                ó   € . # rJ   rÒ   rK   s   &r,   rf   ÚTreeWidget._tags#  s   € Øˆ	rD   c                ó>  € \        V P                  P                  4       4      \        V P                  P                  4       4      ,           pV FK  pVP	                  4       '       g   K  VP                  4        VP                  4        VP                  4        KM  	  R # rJ   )rË   rà   ró   rá   r   Úshowr   r  )r%   Úsegsrø   s   &  r,   r¨   ÚTreeWidget._manage&  sk   € Ü�D×(Ñ(×/Ñ/Ó1Ó2´TØ×!Ñ!×(Ñ(Ó*ó6
õ 
ˆó ˆDØ�{‰{�}Œ}Ø—	‘	”Ø—‘”Ø—	‘	–ó	 rD   c                óÈ  € TpVR,          '       d&   V P                   V P                  V,          ,          pM$V P                  V P                  V,          ,          pVP                  4       V J d*   V P	                  V4       V P                  V4       W0n        MVP                  4       P                  W#4       VP                  4        VP                  4       P                  4       R,          w  rEVP                  4       P                  4       R,          w  rgVP                  Wd,
          Wu,
          4       VP                  4        VP                  4       P                  V4       R# )z
Collapse/expand a tree.
r/   ºNrn   NN)rà   rß   rá   ÚparentrP   r"   ræ   rW   r(  r'   rj   rŠ   r  r>   )r%   r  Úold_treesegÚnew_treesegÚnewxÚnewyÚoldxÚoldys   &&      r,   Útoggle_collapsedÚTreeWidget.toggle_collapsed0  s  € ð ˆØ�v×ÔØ×.Ñ.¨t¯z©z¸+Õ/FÕG‰Kà×/Ñ/°·
±
¸;Õ0GÕHˆKð ×ÑÓ 4Ó'Ø×%Ñ% kÔ2Ø×"Ñ" ;Ô/Ø'�Mà×ÑÓ ×.Ñ.¨{ÔHð 	×ÑÔØ"×(Ñ(Ó*×/Ñ/Ó1°"Õ5‰ˆØ"×(Ñ(Ó*×/Ñ/Ó1°"Õ5‰ˆØ×Ñ˜� d¥kÔ2ð 	×ÑÔð 	×ÑÓ×#Ñ# KÖ0rD   )rá   rà   rß   r×   rã   rÙ   rÚ   rØ   rÔ   rÓ   rÖ   râ   r   rÞ   rÛ   rÜ   rÝ   rÕ   ræ   r   r   N)rr   )r®   r¯   r°   r±   r²   r
   r$   rì   rï   rù   rý   r  r  r  r  rä   rå   r?   rG   rf   r¨   r4  r³   r´   rµ   s   @r,   rÐ   rÐ   ý  sj   ø‡ € ñ&ðR $.¸ô!7òF	2ò	3ô.ô-ô.ô-ô.ô-òBò<ò.=8ò~8ò4ò÷1ð 1rD   rÐ   c                   óD   a € ] tR tRt o R tR tR tR tR tR t	Rt
V tR	# )
ÚTreeViewiU  c                óp  € ^ RI HpHp Wn        \	        4       V n        V P
                  P                  R4       V P
                  P                  RV P                  4       V P
                  P                  RV P                  4       \        V P
                  4      ;q@n
        V P
                  P                  RV P                  P                  4       \        V P
                  4      V n        V P                  P                  ^4       RV P                  P                  4       ) R3pRV P                  P                  4       ) 3p\!        V! V! \#        V4      4      4      4      V n        . V n        \)        \#        V4      4       Fu  p\+        VP-                  4       W,          VRR	R
RR
^VR7
      pVP/                  VP0                  4       V P&                  P3                  V4       VP5                  V^ ^ 4       Kw  	  V P7                  4        V P                  P9                  ^RR7       V P;                  4        R# )r`   )ÚceilÚsqrtÚNLTKz<Control-x>z<Control-q>z<Control-p>Ú	helveticaÚboldz#008040z#004080z#004040Úwhite)Ú	node_fontÚ
leaf_colorÚ
node_colorr  r  r  r  Ú	leaf_fontÚboth)Úexpandr   N)Úmathr9  r:  Ú_treesr   Ú_topÚtitleÚbindÚdestroyr   Ú_cframeÚprint_to_filer   Ú_sizeÚsetr#  r=   rs   Ú_widthÚ_widgetsr‹   rÐ   r&   rù   r4  rb   Ú
add_widgetÚ_layoutÚpackÚ_init_menubar)	r%   Útreesr9  r:  Úcfr=  Úhelvr–   Úwidgets	   &*       r,   r$   ÚTreeView.__init__V  sž  € ß#àŒä“DˆŒ	Ø�	‰	�‰˜ÔØ�	‰	�‰�} d§l¡lÔ3Ø�	‰	�‰�} d§l¡lÔ3ä'¨¯	©	Ó2Ð2ˆŒ\Ø�	‰	�‰�} d§l¡l×&@Ñ&@ÔAô ˜DŸI™IÓ&ˆŒ
Ø�
‰
�‰�rÔØ˜dŸj™jŸn™nÓ.Ð.°Ð7ˆØ˜dŸj™jŸn™nÓ.Ð.Ð/ˆô ™$™t¤C¨£JÓ/Ó0Ó1ˆŒØˆŒÜ”s˜5“zÖ"ˆAÜØ—	‘	“Ø•ØØ$Ø$Ø$Ø!Ø$ØØôˆFð ×#Ñ# F×$;Ñ$;Ô<Ø�M‰M× Ñ  Ô(Ø�M‰M˜& ! QÖ'ñ #ð" 	�‰ŒØ�‰×Ñ ¨ÐÔ0Ø×ÑÖrD   c                ó¶  € ^ ;p;p;r4V P                   p\        \        V P                  4      4       F£  pV P                  V,          pVP	                  4       R,          w  rxW,          ^ 8X  d   Tp^ pVP                  W',
          W8,
          4       VP	                  4       ^,          ^
,           p\        WFP	                  4       ^,          ^
,           4      pK¥  	  R# )r`   r,  N)rO  r‹   rs   rP  rj   rŠ   rv   )	r%   r–   r•   r™   r~   r5   rX  r2  r3  s	   &        r,   rR  ÚTreeView._layout�  s©   € ØÐˆÐˆAÐ�Ø—‘ˆÜ”s˜4Ÿ=™=Ó)Ö*ˆAØ—]‘] 1Õ%ˆFØ!Ÿ;™;›=¨Õ,‰LˆTØ�y˜AŒ~Ø�Ø�Ø�K‰K˜� !¥(Ô+Ø—‘“˜aÕ  2Õ%ˆAÜ�tŸ[™[›]¨1Õ-°Õ2Ó3ŠDó +rD   c                ó   € \        V P                  4      p\        V^ R7      pVP                  R^ V P                  P                  RR7       VP                  R^V P
                  RR7       VP                  R^ VR7       \        V^ R7      pVP                  R	V P                  ^ ^
V P                  R
7       VP                  RV P                  ^ ^V P                  R
7       VP                  RV P                  ^ ^V P                  R
7       VP                  RV P                  ^ ^V P                  R
7       VP                  RV P                  ^ ^2V P                  R
7       VP                  R^ VR7       V P                  P                  VR7       R# )r`   )ÚtearoffzPrint to PostscriptzCtrl-p)r'   Ú	underlineÚcommandÚacceleratorÚExitzCtrl-xÚFile)r'   r^  ÚmenuÚTiny)r'   Úvariabler^  rA   r_  ÚSmallÚMediumÚLargeÚHugeÚZoom)rc  N)r   rG  Úadd_commandrK  rL  rJ  Úadd_cascadeÚadd_radiobuttonrM  ÚresizeÚconfig)r%   ÚmenubarÚfilemenuÚzoommenus   &   r,   rT  ÚTreeView._init_menubarŽ  s�  € Ü�t—y‘y“/ˆä˜¨Ô+ˆØ×ÑØ'ØØ—L‘L×.Ñ.Ø ð	 	ô 	
ð 	×ÑØ A¨t¯|©|Èð 	ô 	
ð 	×Ñ &°A¸HÐÔEä˜¨Ô+ˆØ× Ñ ØØ—Z‘ZØØØ—K‘Kð 	!ô 	
ð 	× Ñ ØØ—Z‘ZØØØ—K‘Kð 	!ô 	
ð 	× Ñ ØØ—Z‘ZØØØ—K‘Kð 	!ô 	
ð 	× Ñ ØØ—Z‘ZØØØ—K‘Kð 	!ô 	
ð 	× Ñ ØØ—Z‘ZØØØ—K‘Kð 	!ô 	
ð 	×Ñ &°A¸HÐÔEà�	‰	×Ñ˜gÐÖ&rD   c                óì  € R V P                   P                  4       ) R3pR V P                   P                  4       ) 3pV P                   P                  4       pV P                   P                  4       pV P                   Fd  pW&R&   W6R&   WFR&   WVR&   V P                   P                  4       ^8  d   ^VR&   K9  V P                   P                  4       ^8  d   ^VR&   K_  ^VR&   Kf  	  V P                  4        R# )r<  r=  r?  rB  r6   r7   r  N)rM  r#  rP  rR  )r%   Úer=  rW  r6   r7   rX  s   &*     r,   rn  ÚTreeView.resizeÅ  sÑ   € Ø˜dŸj™jŸn™nÓ.Ð.°Ð7ˆØ˜dŸj™jŸn™nÓ.Ð.Ð/ˆØ—‘—‘Ó!ˆØ—‘—‘Ó!ˆØ—m”mˆFØ"&�;ÑØ"&�;ÑØ%�8ÑØ%�8ÑØ�z‰z�~‰~Ó "Ô$Ø'(��|Ó$Ø—‘—‘Ó! BÔ&Ø'(��|Ó$à'(��|Ó$ñ $ð 	�‰ŽrD   c                óh   € V P                   f   R # V P                   P                  4        R V n         R # rJ   )rG  rJ  )r%   ru  s   &*r,   rJ  ÚTreeView.destroy×  s&   € Ø�9‰9ÒÙØ�	‰	×ÑÔØˆŽ	rD   c                ób   € \        4       '       d   R# V P                  P                  ! V/ VB  R# )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   rG  Úmainloop)r%   ÚargsÚkwargss   &*,r,   rz  ÚTreeView.mainloopÝ  s%   € ô �9Š9ÙØ�	‰	×Ò˜DÐ+ FÔ+rD   )rK  rM  rG  rF  rP  rO  N)r®   r¯   r°   r±   r$   rR  rT  rn  rJ  rz  r³   r´   rµ   s   @r,   r7  r7  U  s*   ø‡ € ò)òV4ò5'ònò$÷	,ð 	,rD   r7  c                 ó4   € \        V !  P                  4        R# )zT
Open a new window containing a graphical diagram of the given
trees.

:rtype: None
N)r7  rz  )rU  s   *r,   Ú
draw_treesr  é  s   € ô ˆeÑ×ÑÔÙ
rD   c                  ó’  a€ ^ RI oV3R lp \        RR^R7      p\        P                  ! R4      p\	        VP                  4       V^RRRRR	R
R7	      pVP                  V^
^
4       R pR p\        P                  ! R4      p\	        VP                  4       WdV^R7      pV3R lpV3R lp	VP                  VP                  4       VP                  VP                  4       VP                  V^4       VP                  ^4      P                  V	^4       VP                  4       P                  V	^4       \        VP                  4       V4      p
VP                  W£P                  4       ^,          ^
,           ^
4       \        P                  ! R4      p\        VP                  4       VR	^^R7      p^VR&   VP                  V^
VP                  4       ^,          ^
,           4       R pRp\        VP                  4       VP!                  4       4      p\#        VP                  4       VR^R7      pVP                  VVP                  4       ^,          ^
,           VP                  4       ^,          ^
,           4       \        P                  ! R4      p\	        VP                  4       V^RRRRRR7      pVP%                  4        VP                  VVP                  4       ^,          ^
,           VP                  4       ^,          ^
,           4       VP                  V4       VP                  VP                  ^4       VP'                  4        R# ) r`   Nc                 ó@   <€ R SP                  ^ R4      ,          V R&   R# )ú#%06di?B r   N©Úrandint)ÚcwÚrandoms   &€r,   r   Údemo.<locals>.fillü  s   ø€ Ø˜vŸ~™~¨a°Ó8Õ8ˆˆ6‹
rD   i&  iÂ  )r5   ÚheightÚcloseenoughzU
    (S (NP the very big cat)
       (VP (Adv sorta) (V saw) (NP (Det the) (N dog))))r>  ÚblackÚgreen4Úblue2)r  r?  rB  r  r  r@  rA  c           	      ó8   € Rp\        V \        WVR7      RR7      # )r<  )ÚfontÚgreenr   )r<  iðÿÿÿr=  )r   r
   )r&   ÚtextÚbigs   && r,   ÚboxitÚdemo.<locals>.boxit  s   € Ø(ˆÜ˜¤¨F¸sÔ!CÈ'ÔRÐRrD   c                 ó0   € \        V \        W4      R R7      # )Úcyanr   )r   r
   )r&   r�  s   &&r,   ÚovalitÚdemo.<locals>.ovalit  s   € Ü˜&¤*¨VÓ":ÀÔHÐHrD   z/(S (NP this tree) (VP (V is) (AdjP shapeable))))r  c                 ó@   <€ R SP                  ^ R4      ,          V R&   R# )z#%04d00é'  r4   Nrƒ  )r  r†  s   &€r,   r4   Údemo.<locals>.color  s   ø€ Ø! F§N¡N°1°dÓ$;Õ;ˆˆW‹rD   c                 óž   <€ R SP                  ^ R4      ,          V P                  4       R&   RV P                  4       P                  4       R&   R# )r‚  r™  r   r>  r4   N)r„  r'   r\   )r  r†  s   &€r,   Úcolor2Údemo.<locals>.color2!  s<   ø€ Ø")¨F¯N©N¸1¸dÓ,CÕ"Cˆ�‰‹˜ÑØ+2ˆ�‰‹×ÑÓ Ó(rD   zb
    (S (NP this tree) (AUX was)
       (VP (V built) (PP (P with) (NP (N tree_to_treesegment))))))Ú
tree_colorÚtree_xspaceÚ
tree_widthr  c                 óŽ  € V R ,          R8X  dÝ   V P                  ^^4      P                  4       ^ ,          P                  R4       V P                  ^^4      P                  4       ^ ,          P                  R4       V P                  ^4      P                  4       ^,          P                  R4       V P                  4       P                  4       ^,          P                  R4       RV R &   R# V P                  ^^4      P                  4       ^ ,          P                  R4       V P                  ^^4      P                  4       ^ ,          P                  R4       V P                  ^4      P                  4       ^,          P                  R4       V P                  4       P                  4       ^,          P                  R4       RV R &   R# )r1   r2   r3   N)rì   r(   Úset_textrï   )Ú
treewidgets   &r,   ÚorientswitchÚdemo.<locals>.orientswitch9  s_  € Ø�mÕ$¨Ô4Ø×$Ñ$ Q¨Ó*×3Ñ3Ó5°aÕ8×AÑAÀ*ÔMØ×%Ñ% a¨Ó+×4Ñ4Ó6°qÕ9×BÑBÀ:ÔNØ×%Ñ% aÓ(×1Ñ1Ó3°AÕ6×?Ñ?À
ÔKØ×%Ñ%Ó'×0Ñ0Ó2°1Õ5×>Ñ>¸zÔJØ(2ˆJ�}Ó%à×$Ñ$ Q¨Ó*×3Ñ3Ó5°aÕ8×AÑAÀ,ÔOØ×%Ñ% a¨Ó+×4Ñ4Ó6°qÕ9×BÑBÀ<ÔPØ×%Ñ% aÓ(×1Ñ1Ó3°AÕ6×?Ñ?ÀÔMØ×%Ñ%Ó'×0Ñ0Ó2°1Õ5×>Ñ>¸|ÔLØ(4ˆJ�}Ó%rD   aM  
Try clicking, right clicking, and dragging
different elements of each of the trees.
The top-left tree is a TreeWidget built from
a Tree.  The top-right is a TreeWidget built
from a Tree, using non-default widget
constructors for the nodes & leaves (BoxWidget
and OvalWidget).  The bottom-left tree is
built from tree_to_treesegment.)r   r  z/(S (NP this tree) (VP (V is) (Adj horizontal)))Úbrown2Úbrown4r2   )r  r  r  r?  rA  r1   )r<  iòÿÿÿr=  )r<  éôÿÿÿÚitalic)r<  r¨  r=  )r†  r   r   Ú
fromstringrÐ   r&   rQ  rù   r4  r  rì   rô   r	   rj   rÎ   r
   Ústripr   r   rz  )r   rV  r¹   Útcr’  r–  ÚtreetokÚtc2r4   rœ  ÚparenÚtree3Útc3r¤  r�  ÚtwidgetÚtextboxÚtree4Útc4r†  s                      @r,   Údemor¶  ù  s«  ø€ Ûõ9ô 
˜3 s¸Ô	:€Bä�Šð	;ó	€Aô 
Ø
�	‰	‹Ø	ØØ,Ø.ØØØØô

€Bð ‡M�M�"�b˜"ÔòSòIô �oŠoÐOÓP€GÜ
�R—Y‘Y“[ '°&ÀAÔ
F€Cõ<õ3ð ×Ñ˜×+Ñ+Ô,Ø×Ñ˜×-Ñ-Ô.Ø×Ñ˜˜qÔ!Ø×Ñ�aÓ×#Ñ# F¨AÔ.Ø×ÑÓ×"Ñ" 6¨1Ô-ä˜Ÿ	™	› SÓ)€EØ‡M�M�%Ÿ™› 1�¨Õ*¨BÔ/ä�OŠOð	Eó€Eô
 Ø
�	‰	‹�U x¸QÈ1ô€Cð €CˆÑØ‡M�M�#�r˜2Ÿ7™7›9 Q�<¨"Õ,Ô-ò5ð#€Dô ˜Ÿ™› d§j¡j£lÓ3€GÜ˜Ÿ	™	› W°7ÀaÔH€GØ‡M�M�'˜3Ÿ8™8›: a�=¨2Õ-¨s¯x©x«z¸!­}¸rÕ/AÔBä�OŠOÐMÓN€EÜ
Ø
�	‰	‹ØØØØØ,ØØ ô	€Cð ‡J�J„LØ‡M�M�#�s—x‘x“z !•} rÕ)¨7¯<©<«>¸!Õ+<¸rÕ+AÔBØ‡N�N�<Ô Ø×Ñ˜×-Ñ-¨qÔ1ð ‡K�K†MrD   Ú__main__N)r²   Útkinterr   r   r   Únltk.draw.utilr   r   r   r   r	   r
   Ú	nltk.treer   Ú	nltk.utilr   r   r¸   rÎ   rÐ   r7  r  r¶  r®   rÒ   rD   r,   Ú<module>r¼     s�   ðñ÷ %Ñ $÷÷ õ Ý ôE<˜ô E<òP4ð> $¨zô1ôrP1�ô P1÷p
Q,ñ Q,òhò lð^ ˆzÔÙ†Fñ rD   