§
    'ê[fW  ã                   óP   — d Z ddlT ddlT  G d„ d¦  «        Z G d„ de¦  «        ZdS )að  
Read lines from the Prepositional Phrase Attachment Corpus.

The PP Attachment Corpus contains several files having the format:

sentence_id verb noun1 preposition noun2 attachment

For example:

42960 gives authority to administration V
46742 gives inventors of microchip N

The PP attachment is to the verb phrase (V) or noun phrase (N), i.e.:

(VP gives (NP authority) (PP to administration))
(VP gives (NP inventors (PP of microchip)))

The corpus contains the following files:

training:   training set
devset:     development test set, used for algorithm development.
test:       test set, used to report results
bitstrings: word classes derived from Mutual Information Clustering for the Wall Street Journal.

Ratnaparkhi, Adwait (1994). A Maximum Entropy Model for Prepositional
Phrase Attachment.  Proceedings of the ARPA Human Language Technology
Conference.  [http://www.cis.upenn.edu/~adwait/papers/hlt94.ps]

The PP Attachment Corpus is distributed with NLTK with the permission
of the author.
é    )Ú*c                   ó   — e Zd Zd„ Zd„ ZdS )ÚPPAttachmentc                 óZ   — || _         || _        || _        || _        || _        || _        d S ©N©ÚsentÚverbÚnoun1ÚprepÚnoun2Ú
attachment)Úselfr	   r
   r   r   r   r   s          úO/var/www/piapp/venv/lib/python3.11/site-packages/nltk/corpus/reader/ppattach.pyÚ__init__zPPAttachment.__init__.   s0   € ØˆŒ	ØˆŒ	ØˆŒ
ØˆŒ	ØˆŒ
Ø$ˆŒˆˆó    c                 óh   — d| j         ›d| j        ›d| j        ›d| j        ›d| j        ›d| j        ›d�S )NzPPAttachment(sent=z, verb=z, noun1=z, prep=z, noun2=z, attachment=ú)r   )r   s    r   Ú__repr__zPPAttachment.__repr__6   sB   € € ð Œyˆyˆy˜$œ)˜)˜) T¤Z Z Z°´°°¸D¼J¸J¸JÈÌÈÈðYð	
r   N)Ú__name__Ú
__module__Ú__qualname__r   r   © r   r   r   r   -   s2   € € € € € ð%ð %ð %ð
ð 
ð 
ð 
ð 
r   r   c                   ó*   — e Zd ZdZd„ Zd„ Zd„ Zd„ ZdS )ÚPPAttachmentCorpusReaderz=
    sentence_id verb noun1 preposition noun2 attachment
    c                 ób   ‡ — t          ˆ fd„‰                      |d¦  «        D ¦   «         ¦  «        S )Nc                 óD   •— g | ]\  }}t          |‰j        |¬ ¦  «        ‘ŒS ©)Úencoding)ÚStreamBackedCorpusViewÚ_read_obj_block©Ú.0ÚfileidÚencr   s      €r   ú
<listcomp>z8PPAttachmentCorpusReader.attachments.<locals>.<listcomp>E   s?   ø€ ð ð ð á!�V˜Sõ ' v¨tÔ/CÈcÐRÑRÔRðð ð r   T©ÚconcatÚabspaths©r   Úfileidss   ` r   Úattachmentsz$PPAttachmentCorpusReader.attachmentsC   óI   ø€ Ýðð ð ð à%)§]¢]°7¸DÑ%AÔ%Aðñ ô ñ
ô 
ð 	
r   c                 ób   ‡ — t          ˆ fd„‰                      |d¦  «        D ¦   «         ¦  «        S )Nc                 óD   •— g | ]\  }}t          |‰j        |¬ ¦  «        ‘ŒS r   )r    Ú_read_tuple_blockr"   s      €r   r&   z3PPAttachmentCorpusReader.tuples.<locals>.<listcomp>M   s@   ø€ ð ð ð á!�V˜Sõ ' v¨tÔ/EÐPSÐTÑTÔTðð ð r   Tr'   r*   s   ` r   ÚtupleszPPAttachmentCorpusReader.tuplesK   r-   r   c                 óv   — |                      ¦   «         }|r"t          |                     ¦   «         ¦  «        gS g S r   )ÚreadlineÚtupleÚsplit©r   ÚstreamÚlines      r   r0   z*PPAttachmentCorpusReader._read_tuple_blockS   s7   € Ø�ŠÑ Ô ˆØð 	Ý˜$Ÿ*š*™,œ,Ñ'Ô'Ð(Ð(àˆIr   c                 ój   — |                      ¦   «         }|rt          |                     ¦   «         Ž gS g S r   )r3   r   r5   r6   s      r   r!   z(PPAttachmentCorpusReader._read_obj_blockZ   s4   € Ø�ŠÑ Ô ˆØð 	Ý  $§*¢*¡,¤,Ð/Ð0Ð0àˆIr   N)r   r   r   Ú__doc__r,   r1   r0   r!   r   r   r   r   r   >   sZ   € € € € € ðð ð
ð 
ð 
ð
ð 
ð 
ðð ð ðð ð ð ð r   r   N)r:   Únltk.corpus.reader.apiÚnltk.corpus.reader.utilr   ÚCorpusReaderr   r   r   r   ú<module>r>      s†   ððð ð@ %Ð $Ð $Ð $Ø %Ð %Ð %Ð %ð
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð"!ð !ð !ð !ð !˜|ñ !ô !ð !ð !ð !r   