
    '[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      yyy$)))TZZZDJJJ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?       !VS 'vt/CcRRR  r   Tconcatabspathsr   fileidss   ` r   attachmentsz$PPAttachmentCorpusReader.attachmentsC   I       %)]]7D%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@       !VS 'vt/EPS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   