§
    'ê[f<c  ã                   óN   — d Z ddlZddlZddlmZ ddlmZ  G d„ de¦  «        ZdS )z‰
An NLTK interface to the VerbNet verb lexicon

For details about VerbNet see:
https://verbs.colorado.edu/~mpalmer/projects/verbnet.html
é    N)Údefaultdict)ÚXMLCorpusReaderc                   ó<  — e Zd ZdZd$d„Z ej        d¦  «        Z	  ej        d¦  «        Z	  ej        d¦  «        Z		 d%d„Z
d%d	„Zd&d
„Zd„ Zd%d„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd'd„Zd'd„Zd'd„Zd'd„Zd'd„Z d'd „Z!d'd!„Z"d'd"„Z#d'd#„Z$dS )(ÚVerbnetCorpusReadera  
    An NLTK interface to the VerbNet verb lexicon.

    From the VerbNet site: "VerbNet (VN) (Kipper-Schuler 2006) is the largest
    on-line verb lexicon currently available for English. It is a hierarchical
    domain-independent, broad-coverage verb lexicon with mappings to other
    lexical resources such as WordNet (Miller, 1990; Fellbaum, 1998), XTAG
    (XTAG Research Group, 2001), and FrameNet (Baker et al., 1998)."

    For details about VerbNet see:
    https://verbs.colorado.edu/~mpalmer/projects/verbnet.html
    Fc                 óâ   — t          j        | |||¦  «         t          t          ¦  «        | _        	 t          t          ¦  «        | _        	 i | _        	 i | _        |                      ¦   «          d S ©N)	r   Ú__init__r   ÚlistÚ_lemma_to_classÚ_wordnet_to_classÚ_class_to_fileidÚ_shortid_to_longidÚ_quick_index)ÚselfÚrootÚfileidsÚ
wrap_etrees       úN/var/www/piapp/venv/lib/python3.11/site-packages/nltk/corpus/reader/verbnet.pyr	   zVerbnetCorpusReader.__init__%   sy   € ÝÔ   t¨W°jÑAÔAÐAå*­4Ñ0Ô0ˆÔð	&õ "-­TÑ!2Ô!2ˆÔð	/ð !#ˆÔð	Bð #%ˆÔð
 	×ÒÑÔÐÐÐó    z([^\-\.]*)-([\d+.\-]+)$z
[\d+.\-]+$zH<MEMBER name="\??([^"]+)" wn="([^"]*)"[^>]+>|<VNSUBCLASS ID="([^"]+)"/?>Nc                 óä   — |€&t          | j                             ¦   «         ¦  «        S t          |t          ¦  «        r|                      |¦  «        }d„ |                     d¦  «        D ¦   «         S )zx
        Return a list of all verb lemmas that appear in any class, or
        in the ``classid`` if specified.
        Nc                 ó8   — g | ]}|                      d ¦  «        ‘ŒS )Úname©Úget©Ú.0Úmembers     r   ú
<listcomp>z.VerbnetCorpusReader.lemmas.<locals>.<listcomp>S   s$   € ÐWÐWÐW¨6�F—J’J˜vÑ&Ô&ÐWÐWÐWr   úMEMBERS/MEMBER)Úsortedr   ÚkeysÚ
isinstanceÚstrÚvnclassÚfindall©r   r$   s     r   ÚlemmaszVerbnetCorpusReader.lemmasH   sl   € ð
 ˆ?Ý˜$Ô.×3Ò3Ñ5Ô5Ñ6Ô6Ð6õ ˜'¥3Ñ'Ô'ð 0ØŸ,š, wÑ/Ô/�ØWÐW°W·_²_ÐEUÑ5VÔ5VÐWÑWÔWÐWr   c                 ó   — |€&t          | j                             ¦   «         ¦  «        S t          |t          ¦  «        r|                      |¦  «        }t          d„ |                     d¦  «        D ¦   «         g ¦  «        S )z|
        Return a list of all wordnet identifiers that appear in any
        class, or in ``classid`` if specified.
        Nc              3   óf   K  — | ],}|                      d d¦  «                             ¦   «         V — Œ-dS )ÚwnÚ N)r   Úsplitr   s     r   ú	<genexpr>z1VerbnetCorpusReader.wordnetids.<locals>.<genexpr>a   sP   è è € ð ð àð —J’J˜t RÑ(Ô(×.Ò.Ñ0Ô0ðð ð ð ð ð r   r   )r    r   r!   r"   r#   r$   Úsumr%   r&   s     r   Ú
wordnetidszVerbnetCorpusReader.wordnetidsU   s‹   € ð
 ˆ?Ý˜$Ô0×5Ò5Ñ7Ô7Ñ8Ô8Ð8õ ˜'¥3Ñ'Ô'ð 0ØŸ,š, wÑ/Ô/�Ýðð à")§/¢/Ð2BÑ"CÔ"Cðñ ô ð ñô ð r   c                 óF  ‡— ‰�%ˆfd„| j                              ¦   «         D ¦   «         S |�| j        |         S |�| j        |         S |�4|                      |¦  «        }d„ |                     d¦  «        D ¦   «         S t          | j                              ¦   «         ¦  «        S )a—  
        Return a list of the VerbNet class identifiers.  If a file
        identifier is specified, then return only the VerbNet class
        identifiers for classes (and subclasses) defined by that file.
        If a lemma is specified, then return only VerbNet class
        identifiers for classes that contain that lemma as a member.
        If a wordnetid is specified, then return only identifiers for
        classes that contain that wordnetid as a member.  If a classid
        is specified, then return only identifiers for subclasses of
        the specified VerbNet class.
        If nothing is specified, return all classids within VerbNet
        Nc                 ó&   •— g | ]\  }}|‰k    ¯|‘ŒS © r2   )r   ÚcÚfÚfileids      €r   r   z0VerbnetCorpusReader.classids.<locals>.<listcomp>v   s"   ø€ ÐQÐQÐQ™&˜1˜aÀQÈ&Â[À[�AÀ[À[À[r   c                 ó8   — g | ]}|                      d ¦  «        ‘ŒS ©ÚIDr   ©r   Úsubclasss     r   r   z0VerbnetCorpusReader.classids.<locals>.<listcomp>}   s4   € ð ð ð àð —’˜TÑ"Ô"ðð ð r   úSUBCLASSES/VNSUBCLASS)r   Úitemsr   r   r$   r%   r    r!   )r   ÚlemmaÚ	wordnetidr5   ÚclassidÚxmltrees      `  r   ÚclassidszVerbnetCorpusReader.classidsh   sÀ   ø€ ð ÐØQÐQÐQÐQ DÔ$9×$?Ò$?Ñ$AÔ$AÐQÑQÔQÐQØÐØÔ'¨Ô.Ð.ØÐ"ØÔ)¨)Ô4Ð4ØÐ Ø—l’l 7Ñ+Ô+ˆGðð à '§¢Ð0GÑ HÔ Hðñ ô ð õ
 ˜$Ô/×4Ò4Ñ6Ô6Ñ7Ô7Ð7r   c                 ó¬  — || j         v r|                      |¦  «        S |                      |¦  «        }|| j        v r‡| j        |                      |¦  «                 }|                      |¦  «        }||                     d¦  «        k    r|S |                     d¦  «        D ]}||                     d¦  «        k    r|c S Œ J ‚t          d|› �¦  «        ‚)a·  Returns VerbNet class ElementTree

        Return an ElementTree containing the xml for the specified
        VerbNet class.

        :param fileid_or_classid: An identifier specifying which class
            should be returned.  Can be a file identifier (such as
            ``'put-9.1.xml'``), or a VerbNet class identifier (such as
            ``'put-9.1'``) or a short VerbNet class identifier (such as
            ``'9.1'``).
        r8   z.//VNSUBCLASSFzUnknown identifier )Ú_fileidsÚxmlÚlongidr   r   r%   Ú
ValueError)r   Úfileid_or_classidr?   r5   Útreer:   s         r   r$   zVerbnetCorpusReader.vnclass„   së   € ð  ¤Ð-Ð-Ø—8’8Ð-Ñ.Ô.Ð.ð —+’+Ð/Ñ0Ô0ˆØ�dÔ+Ð+Ð+ØÔ*¨4¯;ª;°wÑ+?Ô+?Ô@ˆFØ—8’8˜FÑ#Ô#ˆDØ˜$Ÿ(š( 4™.œ.Ò(Ð(Ø�à $§¢¨_Ñ =Ô =ð !ð !�HØ (§,¢,¨tÑ"4Ô"4Ò4Ð4Ø'˜˜˜ð 5ð !�Lõ ÐFÐ3DÐFÐFÑGÔGÐGr   c                 óž   ‡ — |€‰ j         S t          |t          ¦  «        r!‰ j        ‰                      |¦  «                 gS ˆ fd„|D ¦   «         S )z¼
        Return a list of fileids that make up this corpus.  If
        ``vnclass_ids`` is specified, then return the fileids that make
        up the specified VerbNet class(es).
        Nc                 óP   •— g | ]"}‰j         ‰                     |¦  «                 ‘Œ#S r2   )r   rE   )r   Ú
vnclass_idr   s     €r   r   z/VerbnetCorpusReader.fileids.<locals>.<listcomp>°   s=   ø€ ð ð ð àð Ô% d§k¢k°*Ñ&=Ô&=Ô>ðð ð r   )rC   r"   r#   r   rE   )r   Úvnclass_idss   ` r   r   zVerbnetCorpusReader.fileids¥   sm   ø€ ð ÐØ”=Ð Ý˜¥SÑ)Ô)ð 	ØÔ)¨$¯+ª+°kÑ*BÔ*BÔCÐDÐDðð ð ð à"-ðñ ô ð r   c           	      ó^  — t          |t          ¦  «        r|                      |¦  «        }g }|                     d¦  «        }|D ]h}|                     |                      |¦  «        |                      |¦  «        |                      |¦  «        |                      |¦  «        dœ¦  «         Œi|S )ap  Given a VerbNet class, this method returns VerbNet frames

        The members returned are:
        1) Example
        2) Description
        3) Syntax
        4) Semantics

        :param vnclass: A VerbNet class identifier; or an ElementTree
            containing the xml contents of a VerbNet class.
        :return: frames - a list of frame dictionaries
        zFRAMES/FRAME)ÚexampleÚdescriptionÚsyntaxÚ	semantics)	r"   r#   r$   r%   ÚappendÚ_get_example_within_frameÚ_get_description_within_frameÚ _get_syntactic_list_within_frameÚ_get_semantics_within_frame)r   r$   ÚframesÚvnframesÚvnframes        r   rW   zVerbnetCorpusReader.framesµ   s¼   € õ �g�sÑ#Ô#ð 	,Ø—l’l 7Ñ+Ô+ˆGØˆØ—?’? >Ñ2Ô2ˆØð 	ð 	ˆGØ�MŠMà#×=Ò=¸gÑFÔFØ#'×#EÒ#EÀgÑ#NÔ#NØ"×CÒCÀGÑLÔLØ!%×!AÒ!AÀ'Ñ!JÔ!Jð	ð ñô ð ð ð ˆr   c                 ó˜   — t          |t          ¦  «        r|                      |¦  «        }d„ |                     d¦  «        D ¦   «         }|S )aA  Returns subclass ids, if any exist

        Given a VerbNet class, this method returns subclass ids (if they exist)
        in a list of strings.

        :param vnclass: A VerbNet class identifier; or an ElementTree
            containing the xml contents of a VerbNet class.
        :return: list of subclasses
        c                 ó8   — g | ]}|                      d ¦  «        ‘ŒS r7   r   r9   s     r   r   z2VerbnetCorpusReader.subclasses.<locals>.<listcomp>Þ   s1   € ð 
ð 
ð 
Ø#+ˆH�LŠL˜ÑÔð
ð 
ð 
r   r;   )r"   r#   r$   r%   )r   r$   Ú
subclassess      r   r\   zVerbnetCorpusReader.subclassesÑ   sZ   € õ �g�sÑ#Ô#ð 	,Ø—l’l 7Ñ+Ô+ˆGð
ð 
Ø/6¯ªÐ?VÑ/WÔ/Wð
ñ 
ô 
ˆ
ð Ðr   c                 ó  — t          |t          ¦  «        r|                      |¦  «        }g }|                     d¦  «        D ]J}|                     |                     d¦  «        d„ |                     d¦  «        D ¦   «         dœ¦  «         ŒK|S )ab  Returns thematic roles participating in a VerbNet class

        Members returned as part of roles are-
        1) Type
        2) Modifiers

        :param vnclass: A VerbNet class identifier; or an ElementTree
            containing the xml contents of a VerbNet class.
        :return: themroles: A list of thematic roles in the VerbNet class
        zTHEMROLES/THEMROLEÚtypec                 ód   — g | ]-}|                      d ¦  «        |                      d¦  «        dœ‘Œ.S ©ÚValuer^   ©Úvaluer^   r   ©r   Úrestrs     r   r   z1VerbnetCorpusReader.themroles.<locals>.<listcomp>ö   sH   € ð "ð "ð "à!ð #(§)¢)¨GÑ"4Ô"4¸e¿iºiÈÑ>OÔ>OÐPÐPð"ð "ð "r   úSELRESTRS/SELRESTR)r^   Ú	modifiers)r"   r#   r$   r%   rR   r   )r   r$   Ú	themrolesÚtroles       r   rh   zVerbnetCorpusReader.themrolesã   s¯   € õ �g�sÑ#Ô#ð 	,Ø—l’l 7Ñ+Ô+ˆGàˆ	Ø—_’_Ð%9Ñ:Ô:ð 		ð 		ˆEØ×Òà!ŸIšI fÑ-Ô-ð"ð "à%*§]¢]Ð3GÑ%HÔ%Hð"ñ "ô "ðð ñô ð ð ð Ðr   c                 ól   — | j         D ]+}|                      |                      |¦  «        |¦  «         Œ,dS )aC  
        Initialize the indexes ``_lemma_to_class``,
        ``_wordnet_to_class``, and ``_class_to_fileid`` by scanning
        through the corpus fileids.  This is fast if ElementTree
        uses the C implementation (<0.1 secs), but quite slow (>10 secs)
        if only the python implementation is available.
        N)rC   Ú_index_helperrD   )r   r5   s     r   Ú_indexzVerbnetCorpusReader._index  sD   € ð ”mð 	9ð 	9ˆFØ×Ò˜tŸxšx¨Ñ/Ô/°Ñ8Ô8Ð8Ð8ð	9ð 	9r   c                 ó  — |                      d¦  «        }|| j        |<   || j        |                      |¦  «        <   |                     d¦  «        D ]€}| j        |                      d¦  «                                      |¦  «         |                      dd¦  «                             ¦   «         D ]"}| j        |                              |¦  «         Œ#Œ�|                     d¦  «        D ]}|  	                    ||¦  «         ŒdS )zHelper for ``_index()``r8   r   r   r*   r+   r;   N)
r   r   r   Úshortidr%   r   rR   r,   r   rk   )r   r@   r5   r$   r   r*   r:   s          r   rk   z!VerbnetCorpusReader._index_helper  s	  € à—+’+˜dÑ#Ô#ˆØ)/ˆÔ˜gÑ&Ø9@ˆÔ §¢¨WÑ 5Ô 5Ñ6Ø—o’oÐ&6Ñ7Ô7ð 	;ð 	;ˆFØÔ  §¢¨FÑ!3Ô!3Ô4×;Ò;¸GÑDÔDÐDØ—j’j  rÑ*Ô*×0Ò0Ñ2Ô2ð ;ð ;�ØÔ& rÔ*×1Ò1°'Ñ:Ô:Ð:Ð:ð;àŸšÐ(?Ñ@Ô@ð 	1ð 	1ˆHØ×Ò˜x¨Ñ0Ô0Ð0Ð0ð	1ð 	1r   c                 óÈ  — | j         D �]X}|dd…         }|| j        |<   || j        |                      |¦  «        <   |                      |¦  «        5 }| j                             |                     ¦   «         ¦  «        D ]É}|                     ¦   «         }|d         �d| j	        |d                   
                    |¦  «         |d                              ¦   «         D ]"}| j        |          
                    |¦  «         Œ#Œ‚|d         �6|| j        |d         <   |d         }|| j        |                      |¦  «        <   ŒÀJ d¦   «         ‚	 ddd¦  «         n# 1 swxY w Y   �ŒZdS )aÄ  
        Initialize the indexes ``_lemma_to_class``,
        ``_wordnet_to_class``, and ``_class_to_fileid`` by scanning
        through the corpus fileids.  This doesn't do proper xml parsing,
        but is good enough to find everything in the standard VerbNet
        corpus -- and it runs about 30 times faster than xml parsing
        (with the python ElementTree; only 2-3 times faster
        if ElementTree uses the C implementation).
        Néüÿÿÿr   é   é   Fzunexpected match condition)rC   r   r   rn   ÚopenÚ	_INDEX_REÚfinditerÚreadÚgroupsr   rR   r,   r   )r   r5   r$   ÚfpÚmrw   r*   s          r   r   z VerbnetCorpusReader._quick_index  sÄ  € ð ”mð 	Cñ 	CˆFØ˜S˜b˜S”kˆGØ-3ˆDÔ! 'Ñ*Ø=DˆDÔ# D§L¢L°Ñ$9Ô$9Ñ:Ø—’˜6Ñ"Ô"ð C bØœ×0Ò0°·²±´Ñ;Ô;ð Cð C�AØŸXšX™ZœZ�FØ˜a”yÐ,ØÔ,¨V°A¬YÔ7×>Ò>¸wÑGÔGÐGØ"(¨¤)§/¢/Ñ"3Ô"3ð Gð G˜BØ Ô2°2Ô6×=Ò=¸gÑFÔFÐFÐFðGà œÐ.Ø;A˜Ô-¨f°Q¬iÑ8Ø"(¨¤)˜ØIP˜Ô/°·²¸WÑ0EÔ0EÑFÐFàBÐ&BÑBÔBÐBðCðCð Cð Cñ Cô Cð Cð Cð Cð Cð Cð Cøøøð Cð Cð Cð Cùð		Cð 	Cs   ÁC7EÅE	ÅE	c                 óø   — | j                              |¦  «        r|S | j                             |¦  «        st          d|z  ¦  «        ‚	 | j        |         S # t
          $ r}t          d|z  ¦  «        |‚d}~ww xY w)zÔReturns longid of a VerbNet class

        Given a short VerbNet class identifier (eg '37.10'), map it
        to a long id (eg 'confess-37.10').  If ``shortid`` is already a
        long id, then return it as-isúvnclass identifier %r not foundN)Ú
_LONGID_REÚmatchÚ_SHORTID_RErF   r   ÚKeyError)r   rn   Úes      r   rE   zVerbnetCorpusReader.longid;  s�   € ð Œ?× Ò  Ñ)Ô)ð 	JØˆNØÔ!×'Ò'¨Ñ0Ô0ð 	JÝÐ>ÀÑHÑIÔIÐIð	QØÔ*¨7Ô3Ð3øÝð 	Qð 	Qð 	QÝÐ>ÀÑHÑIÔIÈqÐPøøøøð	Qøøøs   Á
A Á
A9Á!A4Á4A9c                 óÀ   — | j                              |¦  «        r|S | j                             |¦  «        }|r|                     d¦  «        S t	          d|z  ¦  «        ‚)zÖReturns shortid of a VerbNet class

        Given a long VerbNet class identifier (eg 'confess-37.10'),
        map it to a short id (eg '37.10').  If ``longid`` is already a
        short id, then return it as-is.rr   r{   )r~   r}   r|   ÚgrouprF   )r   rE   ry   s      r   rn   zVerbnetCorpusReader.shortidJ  sd   € ð Ô×!Ò! &Ñ)Ô)ð 	ØˆMØŒO×!Ò! &Ñ)Ô)ˆØð 	IØ—7’7˜1‘:”:ÐåÐ>ÀÑGÑHÔHÐHr   c                 óþ   — g }|                      d¦  «        D ]d}d„ |                      d¦  «        D ¦   «         }|                     |                     d¦  «        ||                     d¦  «        dk    dœ¦  «         Œe|S )an  Returns semantics within a single frame

        A utility function to retrieve semantics within a frame in VerbNet
        Members of the semantics dictionary:
        1) Predicate value
        2) Arguments

        :param vnframe: An ElementTree containing the xml contents of
            a VerbNet frame.
        :return: semantics: semantics dictionary
        zSEMANTICS/PREDc                 ód   — g | ]-}|                      d ¦  «        |                      d¦  «        dœ‘Œ.S )r^   rc   )r^   rc   r   )r   Úargs     r   r   zCVerbnetCorpusReader._get_semantics_within_frame.<locals>.<listcomp>j  sF   € ð ð ð àð Ÿš ™œ°3·7²7¸7Ñ3CÔ3CÐDÐDðð ð r   zARGS/ARGrc   Úboolú!)Úpredicate_valueÚ	argumentsÚnegated)r%   rR   r   )r   rY   Úsemantics_within_single_frameÚpredr‰   s        r   rV   z/VerbnetCorpusReader._get_semantics_within_frame\  s§   € ð )+Ð%Ø—O’OÐ$4Ñ5Ô5ð 	ð 	ˆDðð àŸ<š<¨
Ñ3Ô3ðñ ô ˆIð *×0Ò0à'+§x¢x°Ñ'8Ô'8Ø!*Ø#Ÿxšx¨Ñ/Ô/°3Ò6ðð ñô ð ð ð -Ð,r   c                 óH   — |                      d¦  «        }|�|j        }nd}|S )a'  Returns example within a frame

        A utility function to retrieve an example within a frame in VerbNet.

        :param vnframe: An ElementTree containing the xml contents of
            a VerbNet frame.
        :return: example_text: The example sentence for this particular frame
        zEXAMPLES/EXAMPLENr+   )ÚfindÚtext)r   rY   Úexample_elementÚexample_texts       r   rS   z-VerbnetCorpusReader._get_example_within_framew  s1   € ð "Ÿ,š,Ð'9Ñ:Ô:ˆØÐ&Ø*Ô/ˆLˆLàˆLØÐr   c                 ót   — |                      d¦  «        }|j        d         |                     dd¦  «        dœS )ab  Returns member description within frame

        A utility function to retrieve a description of participating members
        within a frame in VerbNet.

        :param vnframe: An ElementTree containing the xml contents of
            a VerbNet frame.
        :return: description: a description dictionary with members - primary and secondary
        ÚDESCRIPTIONÚprimaryÚ	secondaryr+   )r”   r•   )rŽ   Úattribr   )r   rY   Údescription_elements      r   rT   z1VerbnetCorpusReader._get_description_within_frame‡  sC   € ð &Ÿlšl¨=Ñ9Ô9Ðà*Ô1°)Ô<Ø,×0Ò0°¸bÑAÔAð
ð 
ð 	
r   c                 ób  — g }|                      d¦  «        D ]–}|j        }t          ¦   «         }d|j        v r|                     d¦  «        nd|d<   d„ |                     d¦  «        D ¦   «         |d<   d„ |                     d¦  «        D ¦   «         |d	<   |                     ||d
œ¦  «         Œ—|S )a[  Returns semantics within a frame

        A utility function to retrieve semantics within a frame in VerbNet.
        Members of the syntactic dictionary:
        1) POS Tag
        2) Modifiers

        :param vnframe: An ElementTree containing the xml contents of
            a VerbNet frame.
        :return: syntax_within_single_frame
        ÚSYNTAXrc   r+   c                 ód   — g | ]-}|                      d ¦  «        |                      d¦  «        dœ‘Œ.S r`   r   rd   s     r   r   zHVerbnetCorpusReader._get_syntactic_list_within_frame.<locals>.<listcomp>¨  óH   € ð &ð &ð &àð  Ÿ)š) GÑ,Ô,°e·i²iÀÑ6GÔ6GÐHÐHð&ð &ð &r   rf   Ú	selrestrsc                 ód   — g | ]-}|                      d ¦  «        |                      d¦  «        dœ‘Œ.S r`   r   rd   s     r   r   zHVerbnetCorpusReader._get_syntactic_list_within_frame.<locals>.<listcomp>¬  r›   r   zSYNRESTRS/SYNRESTRÚ	synrestrs)Úpos_tagrg   )rŽ   ÚtagÚdictr–   r   r%   rR   )r   rY   Úsyntax_within_single_frameÚeltrŸ   rg   s         r   rU   z4VerbnetCorpusReader._get_syntactic_list_within_frame—  sï   € ð &(Ð"Ø—<’< Ñ)Ô)ð 	ð 	ˆCØ”gˆGÝ™œˆIØ5<ÀÄ
Ð5JÐ5J §¢¨Ñ!1Ô!1Ð!1ÐPRˆI�gÑð&ð &à Ÿ[š[Ð)=Ñ>Ô>ð&ñ &ô &ˆI�kÑ"ð&ð &à Ÿ[š[Ð)=Ñ>Ô>ð&ñ &ô &ˆI�kÑ"ð '×-Ò-Ø#°)Ð<Ð<ñô ð ð ð *Ð)r   c                 ó€  — t          |t          ¦  «        r|                      |¦  «        }|                     d¦  «        dz   }||                      |d¬¦  «        dz   z  }||                      |d¬¦  «        dz   z  }|dz  }||                      |d¬¦  «        dz   z  }|dz  }||                      |d¬¦  «        z  }|S )a%  Returns pretty printed version of a VerbNet class

        Return a string containing a pretty-printed representation of
        the given VerbNet class.

        :param vnclass: A VerbNet class identifier; or an ElementTree
            containing the xml contents of a VerbNet class.
        r8   Ú
ú  )Úindentz  Thematic roles:
ú    z
  Frames:
)r"   r#   r$   r   Úpprint_subclassesÚpprint_membersÚpprint_themrolesÚpprint_frames)r   r$   Úss      r   ÚpprintzVerbnetCorpusReader.pprint¹  sÚ   € õ �g�sÑ#Ô#ð 	,Ø—l’l 7Ñ+Ô+ˆGà�KŠK˜ÑÔ Ñ$ˆØ	ˆT×#Ò# G°DÐ#Ñ9Ô9¸DÑ@Ñ@ˆØ	ˆT× Ò  °Ð Ñ6Ô6¸Ñ=Ñ=ˆØ	Ð"Ñ"ˆØ	ˆT×"Ò" 7°6Ð"Ñ:Ô:¸TÑAÑAˆØ	ˆ]ÑˆØ	ˆT×Ò °ÐÑ7Ô7Ñ7ˆØˆr   r+   c                 óð   — t          |t          ¦  «        r|                      |¦  «        }|                      |¦  «        }|sdg}dd                     |¦  «        z   }t          j        |d||dz   ¬¦  «        S )a>  Returns pretty printed version of subclasses of VerbNet class

        Return a string containing a pretty-printed representation of
        the given VerbNet class's subclasses.

        :param vnclass: A VerbNet class identifier; or an ElementTree
            containing the xml contents of a VerbNet class.
        ú(none)zSubclasses: Ú éF   r¦   ©Úinitial_indentÚsubsequent_indent)r"   r#   r$   r\   ÚjoinÚtextwrapÚfill)r   r$   r§   r\   r­   s        r   r©   z%VerbnetCorpusReader.pprint_subclassesÎ  sƒ   € õ �g�sÑ#Ô#ð 	,Ø—l’l 7Ñ+Ô+ˆGà—_’_ WÑ-Ô-ˆ
Øð 	$Ø"˜ˆJØ˜SŸXšX jÑ1Ô1Ñ1ˆÝŒ}Øˆr &¸FÀT¹Mð
ñ 
ô 
ð 	
r   c                 óð   — t          |t          ¦  «        r|                      |¦  «        }|                      |¦  «        }|sdg}dd                     |¦  «        z   }t          j        |d||dz   ¬¦  «        S )a?  Returns pretty printed version of members in a VerbNet class

        Return a string containing a pretty-printed representation of
        the given VerbNet class's member verbs.

        :param vnclass: A VerbNet class identifier; or an ElementTree
            containing the xml contents of a VerbNet class.
        r°   z	Members: r±   r²   r¦   r³   )r"   r#   r$   r'   r¶   r·   r¸   )r   r$   r§   Úmembersr­   s        r   rª   z"VerbnetCorpusReader.pprint_membersâ  sƒ   € õ �g�sÑ#Ô#ð 	,Ø—l’l 7Ñ+Ô+ˆGà—+’+˜gÑ&Ô&ˆØð 	!Ø�jˆGØ˜#Ÿ(š( 7Ñ+Ô+Ñ+ˆÝŒ}Øˆr &¸FÀT¹Mð
ñ 
ô 
ð 	
r   c                 ó’  — t          |t          ¦  «        r|                      |¦  «        }g }|                      |¦  «        D ]q}|dz   |                     d¦  «        z   }d„ |d         D ¦   «         }|r+|d                     d                     |¦  «        ¦  «        z  }|                     |¦  «         Œrd                     |¦  «        S )aH  Returns pretty printed version of thematic roles in a VerbNet class

        Return a string containing a pretty-printed representation of
        the given VerbNet class's thematic roles.

        :param vnclass: A VerbNet class identifier; or an ElementTree
            containing the xml contents of a VerbNet class.
        ú* r^   c                 ó0   — g | ]}|d          |d         z   ‘ŒS rb   r2   )r   Úmodifiers     r   r   z8VerbnetCorpusReader.pprint_themroles.<locals>.<listcomp>  s7   € ð ð ð àð ˜Ô! H¨VÔ$4Ñ4ðð ð r   rg   ú[{}]r±   r¥   )r"   r#   r$   rh   r   Úformatr¶   rR   )r   r$   r§   ÚpiecesÚthemroleÚpiecerg   s          r   r«   z$VerbnetCorpusReader.pprint_themrolesö  s×   € õ �g�sÑ#Ô#ð 	,Ø—l’l 7Ñ+Ô+ˆGàˆØŸš wÑ/Ô/ð 	!ð 	!ˆHØ˜T‘M H§L¢L°Ñ$8Ô$8Ñ8ˆEðð à (¨Ô 5ðñ ô ˆIð ð <Ø˜Ÿš s§x¢x°	Ñ':Ô':Ñ;Ô;Ñ;�Ø�MŠM˜%Ñ Ô Ð Ð Ø�yŠy˜Ñ Ô Ð r   c                 ó  — t          |t          ¦  «        r|                      |¦  «        }g }|                      |¦  «        D ]+}|                     |                      ||¦  «        ¦  «         Œ,d                     |¦  «        S )a?  Returns pretty version of all frames in a VerbNet class

        Return a string containing a pretty-printed representation of
        the list of frames within the VerbNet class.

        :param vnclass: A VerbNet class identifier; or an ElementTree
            containing the xml contents of a VerbNet class.
        r¥   )r"   r#   r$   rW   rR   Ú_pprint_single_framer¶   )r   r$   r§   rÁ   rY   s        r   r¬   z!VerbnetCorpusReader.pprint_frames  s€   € õ �g�sÑ#Ô#ð 	,Ø—l’l 7Ñ+Ô+ˆGØˆØ—{’{ 7Ñ+Ô+ð 	Fð 	FˆGØ�MŠM˜$×3Ò3°G¸VÑDÔDÑEÔEÐEÐEØ�yŠy˜Ñ Ô Ð r   c                 óü   — |                       ||¦  «        dz   }||                      ||dz   ¦  «        dz   z  }||                      ||dz   ¦  «        dz   z  }||dz   z  }||                      ||dz   ¦  «        z  }|S )a  Returns pretty printed version of a single frame in a VerbNet class

        Returns a string containing a pretty-printed representation of
        the given frame.

        :param vnframe: An ElementTree containing the xml contents of
            a VerbNet frame.
        r¥   r±   z
  Syntax: z  Semantics:
r¨   )Ú _pprint_description_within_frameÚ_pprint_example_within_frameÚ_pprint_syntax_within_frameÚ_pprint_semantics_within_frame)r   rY   r§   Úframe_strings       r   rÅ   z(VerbnetCorpusReader._pprint_single_frame  s    € ð ×<Ò<¸WÀfÑMÔMÐPTÑTˆØ˜×9Ò9¸'À6ÈCÁ<ÑPÔPÐSWÑWÑWˆØØ×,Ò,¨W°f¸|Ñ6KÑLÔLÈtÑSñ	
ˆð 	˜Ð!1Ñ1Ñ1ˆØ˜×;Ò;¸GÀVÈfÁ_ÑUÔUÑUˆØÐr   c                 ó2   — |d         r|dz   |d         z   S dS )a&  Returns pretty printed version of example within frame in a VerbNet class

        Return a string containing a pretty-printed representation of
        the given VerbNet frame example.

        :param vnframe: An ElementTree containing the xml contents of
            a Verbnet frame.
        rN   z
 Example: Nr2   )r   rY   r§   s      r   rÈ   z0VerbnetCorpusReader._pprint_example_within_frame0  s0   € ð �9Ôð 	>Ø˜LÑ(¨7°9Ô+=Ñ=Ð=ð	>ð 	>r   c                 óŒ   — ||d         d         z   }|d         d         r$|d                      |d         d         ¦  «        z  }|S )a  Returns pretty printed version of a VerbNet frame description

        Return a string containing a pretty-printed representation of
        the given VerbNet frame description.

        :param vnframe: An ElementTree containing the xml contents of
            a VerbNet frame.
        rO   r”   r•   z ({})©rÀ   )r   rY   r§   rO   s       r   rÇ   z4VerbnetCorpusReader._pprint_description_within_frame<  sQ   € ð ˜w }Ô5°iÔ@Ñ@ˆØ�=Ô! +Ô.ð 	OØ˜7Ÿ>š>¨'°-Ô*@ÀÔ*MÑNÔNÑNˆKØÐr   c                 óª  — g }|d         D ]±}|d         }g }d|d         v r/|d         d         r!|                      |d         d         ¦  «         |d„ |d         d         |d         d         z   D ¦   «         z  }|r+|d                     d	                     |¦  «        ¦  «        z  }|                      |¦  «         Œ²|d	                     |¦  «        z   S )
a&  Returns pretty printed version of syntax within a frame in a VerbNet class

        Return a string containing a pretty-printed representation of
        the given VerbNet frame syntax.

        :param vnframe: An ElementTree containing the xml contents of
            a VerbNet frame.
        rP   rŸ   rc   rg   c                 óR   — g | ]$}d                       |d         |d         ¦  «        ‘Œ%S )z{}{}rc   r^   rÎ   rd   s     r   r   zCVerbnetCorpusReader._pprint_syntax_within_frame.<locals>.<listcomp>Y  s>   € ð ð ð àð —’˜e Gœn¨e°F¬mÑ<Ô<ðð ð r   rœ   rž   r¿   r±   )rR   rÀ   r¶   )r   rY   r§   rÁ   ÚelementrÃ   Úmodifier_lists          r   rÉ   z/VerbnetCorpusReader._pprint_syntax_within_frameJ  s  € ð ˆØ˜xÔ(ð 	!ð 	!ˆGØ˜IÔ&ˆEØˆMØ˜' +Ô.Ð.Ð.°7¸;Ô3GÈÔ3PÐ.Ø×$Ò$ W¨[Ô%9¸'Ô%BÑCÔCÐCØð ð ð ˜KÔ(¨Ô5Ø˜kÔ*¨;Ô7ñ8ðñ ô ñ ˆMð ð @Ø˜Ÿš s§x¢x°Ñ'>Ô'>Ñ?Ô?Ñ?�Ø�MŠM˜%Ñ Ô Ð Ð à˜Ÿš Ñ(Ô(Ñ(Ð(r   c           	      ó  ‡— g }|d         D ]T}d„ |d         D ¦   «         }|                      |d         rdnd› |d         › dd	                     |¦  «        › d
�¦  «         ŒUd                     ˆfd„|D ¦   «         ¦  «        S )a,  Returns a pretty printed version of semantics within frame in a VerbNet class

        Return a string containing a pretty-printed representation of
        the given VerbNet frame semantics.

        :param vnframe: An ElementTree containing the xml contents of
            a VerbNet frame.
        rQ   c                 ó   — g | ]
}|d          ‘ŒS )rc   r2   )r   Úarguments     r   r   zFVerbnetCorpusReader._pprint_semantics_within_frame.<locals>.<listcomp>q  s   € ÐRÐRÐR¨x˜ 'Ô*ÐRÐRÐRr   r‰   rŠ   õ   Â¬r+   rˆ   ú(z, ú)r¥   c              3   ó&   •K  — | ]}‰› d |› �V — ŒdS )r¼   Nr2   )r   rÃ   r§   s     €r   r-   zEVerbnetCorpusReader._pprint_semantics_within_frame.<locals>.<genexpr>u  s1   øè è € ÐBÐB°%˜FÐ-Ð- eÐ-Ð-ÐBÐBÐBÐBÐBÐBr   )rR   r¶   )r   rY   r§   rÁ   Ú	predicater‰   s     `   r   rÊ   z2VerbnetCorpusReader._pprint_semantics_within_framef  s·   ø€ ð ˆØ  Ô-ð 	ð 	ˆIØRÐR¸9À[Ô;QÐRÑRÔRˆIØ�MŠMØ$ YÔ/Ð7�4�4°RÐo¸ÐCTÔ9UÐoÐoÐX\×XaÒXaÐbkÑXlÔXlÐoÐoÐoñô ð ð ð �yŠyÐBÐBÐBÐB¸6ÐBÑBÔBÑBÔBÐBr   )Fr   )NNNN)r+   )%Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   ÚreÚcompiler|   r~   rt   r'   r/   rA   r$   r   rW   r\   rh   rl   rk   r   rE   rn   rV   rS   rT   rU   r®   r©   rª   r«   r¬   rÅ   rÈ   rÇ   rÉ   rÊ   r2   r   r   r   r      sg  € € € € € ðð ðð ð ð ð. �”Ð6Ñ7Ô7€JØBà�"”*˜]Ñ+Ô+€KØ2à�”
ØWñô €Ið!ðXð Xð Xð Xðð ð ð ð&8ð 8ð 8ð 8ð8Hð Hð HðBð ð ð ð ð ð ð8ð ð ð$ð ð ð>	9ð 	9ð 	9ð
1ð 
1ð 
1ðCð Cð CðDQð Qð QðIð Ið Ið$-ð -ð -ð6ð ð ð 
ð 
ð 
ð *ð *ð *ðDð ð ð*
ð 
ð 
ð 
ð(
ð 
ð 
ð 
ð(!ð !ð !ð !ð0!ð !ð !ð !ð ð ð ð ð$
>ð 
>ð 
>ð 
>ðð ð ð ð)ð )ð )ð )ð8Cð Cð Cð Cð Cð Cr   r   )rÞ   rß   r·   Úcollectionsr   Únltk.corpus.reader.xmldocsr   r   r2   r   r   ú<module>rã      s�   ððð ð 
€	€	€	Ø €€€Ø #Ð #Ð #Ð #Ð #Ð #à 6Ð 6Ð 6Ð 6Ð 6Ð 6ð_	Cð _	Cð _	Cð _	Cð _	C˜/ñ _	Cô _	Cð _	Cð _	Cð _	Cr   