§
    'ê[f�  ã                   ó~   — d dl mZ d dlmZmZmZ d dlmZmZ d dl	m
Z
mZ  G d„ de¦  «        Z G d„ de¦  «        Zd	S )
é    )ÚCorpusReader)ÚStreamBackedCorpusViewÚconcatÚread_alignedsent_block)ÚRegexpTokenizerÚWhitespaceTokenizer)ÚAlignedSentÚ	Alignmentc                   ób   — e Zd ZdZd e¦   «          edd¬¦  «        edfd„Zdd	„Zdd
„Z	dd„Z
dS )ÚAlignedCorpusReaderz’
    Reader for corpora of word-aligned sentences.  Tokens are assumed
    to be separated by whitespace.  Sentences begin on separate lines.
    ú/Ú
T)ÚgapsÚlatin1c                 ól   — t          j        | |||¦  «         || _        || _        || _        || _        dS )a˜  
        Construct a new Aligned Corpus reader for a set of documents
        located at the given root directory.  Example usage:

            >>> root = '/...path to corpus.../'
            >>> reader = AlignedCorpusReader(root, '.*', '.txt') # doctest: +SKIP

        :param root: The root directory for this corpus.
        :param fileids: A list or regexp specifying the fileids in this corpus.
        N)r   Ú__init__Ú_sepÚ_word_tokenizerÚ_sent_tokenizerÚ_alignedsent_block_reader)ÚselfÚrootÚfileidsÚsepÚword_tokenizerÚsent_tokenizerÚalignedsent_block_readerÚencodings           úN/var/www/piapp/venv/lib/python3.11/site-packages/nltk/corpus/reader/aligned.pyr   zAlignedCorpusReader.__init__   s@   € õ( 	Ô˜d D¨'°8Ñ<Ô<Ð<ØˆŒ	Ø-ˆÔØ-ˆÔØ)AˆÔ&Ð&Ð&ó    Nc                 ób   ‡ — t          ˆ fd„‰                      |d¦  «        D ¦   «         ¦  «        S )z~
        :return: the given file(s) as a list of words
            and punctuation symbols.
        :rtype: list(str)
        c                 ó^   •— g | ])\  }}t          ||d d ‰j        ‰j        ‰j        ¦  «        ‘Œ*S )F©ÚAlignedSentCorpusViewr   r   r   ©Ú.0ÚfileidÚencr   s      €r   ú
<listcomp>z-AlignedCorpusReader.words.<locals>.<listcomp>9   sW   ø€ ð ð ð ñ "�V˜Sõ &ØØØØØÔ(ØÔ(ØÔ2ñô ðð ð r    T©r   Úabspaths©r   r   s   ` r   ÚwordszAlignedCorpusReader.words2   sM   ø€ õ ðð ð ð ð &*§]¢]°7¸DÑ%AÔ%Aðñ ô ñ
ô 
ð 	
r    c                 ób   ‡ — t          ˆ fd„‰                      |d¦  «        D ¦   «         ¦  «        S )z²
        :return: the given file(s) as a list of
            sentences or utterances, each encoded as a list of word
            strings.
        :rtype: list(list(str))
        c                 ó^   •— g | ])\  }}t          ||d d‰j        ‰j        ‰j        ¦  «        ‘Œ*S )FTr#   r%   s      €r   r)   z-AlignedCorpusReader.sents.<locals>.<listcomp>O   sW   ø€ ð ð ð ñ "�V˜Sõ &ØØØØØÔ(ØÔ(ØÔ2ñô ðð ð r    Tr*   r,   s   ` r   ÚsentszAlignedCorpusReader.sentsG   sM   ø€ õ ðð ð ð ð &*§]¢]°7¸DÑ%AÔ%Aðñ ô ñ
ô 
ð 	
r    c                 ób   ‡ — t          ˆ fd„‰                      |d¦  «        D ¦   «         ¦  «        S )zp
        :return: the given file(s) as a list of AlignedSent objects.
        :rtype: list(AlignedSent)
        c                 ó^   •— g | ])\  }}t          ||d d ‰j        ‰j        ‰j        ¦  «        ‘Œ*S )Tr#   r%   s      €r   r)   z5AlignedCorpusReader.aligned_sents.<locals>.<listcomp>c   sW   ø€ ð ð ð ñ "�V˜Sõ &ØØØØØÔ(ØÔ(ØÔ2ñô ðð ð r    Tr*   r,   s   ` r   Úaligned_sentsz!AlignedCorpusReader.aligned_sents]   sM   ø€ õ
 ðð ð ð ð &*§]¢]°7¸DÑ%AÔ%Aðñ ô ñ
ô 
ð 	
r    )N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r-   r0   r3   © r    r   r   r      s›   € € € € € ðð ð Ø*Ð*Ñ,Ô,Ø&� t°$Ð7Ñ7Ô7Ø!7ØðBð Bð Bð Bð4
ð 
ð 
ð 
ð*
ð 
ð 
ð 
ð,
ð 
ð 
ð 
ð 
ð 
r    r   c                   ó   — e Zd ZdZd„ Zd„ ZdS )r$   z³
    A specialized corpus view for aligned sentences.
    ``AlignedSentCorpusView`` objects are typically created by
    ``AlignedCorpusReader`` (not directly by nltk users).
    c                 óz   — || _         || _        || _        || _        || _        t          j        | ||¬¦  «         d S )N)r   )Ú_alignedÚ_group_by_sentr   r   r   r   r   )r   Úcorpus_filer   ÚalignedÚgroup_by_sentr   r   r   s           r   r   zAlignedSentCorpusView.__init__y   sI   € ð  ˆŒØ+ˆÔØ-ˆÔØ-ˆÔØ)AˆÔ&ÝÔ'¨¨kÀHÐMÑMÔMÐMÐMÐMr    c                 ó   ‡ — ˆ fd„‰                       |¦  «        D ¦   «         }‰ j        r;t          j        d                     |d         ¦  «        ¦  «        |d<   t          |Ž g}n‰ j        r
|d         g}n|d         }|S )Nc                 ó~   •— g | ]9}‰j                              |¦  «        D ]}‰j                             |¦  «        ‘ŒŒ:S r8   )r   Útokenizer   )r&   Úalignedsent_strÚsent_strr   s      €r   r)   z4AlignedSentCorpusView.read_block.<locals>.<listcomp>‹   sb   ø€ ð 
ð 
ð 
àØ Ô0×9Ò9¸/ÑJÔJð
ð 
ð ð Ô ×)Ò)¨(Ñ3Ô3ð
ð 
ð 
ð 
r    Ú é   r   )r   r;   r
   Ú
fromstringÚjoinr	   r<   )r   ÚstreamÚblocks   `  r   Ú
read_blockz AlignedSentCorpusView.read_blockŠ   s¥   ø€ ð
ð 
ð 
ð 
à#'×#AÒ#AÀ&Ñ#IÔ#Ið
ñ 
ô 
ˆð
 Œ=ð 	Ý Ô+Ø—’˜˜qœÑ"Ô"ñô ˆE�!‰Hõ ! %Ð(Ð)ˆEˆEØÔ ð 	Ø˜1”X�JˆEˆEà˜!”HˆEàˆr    N)r4   r5   r6   r7   r   rK   r8   r    r   r$   r$   r   s?   € € € € € ðð ðNð Nð Nð"ð ð ð ð r    r$   N)Únltk.corpus.reader.apir   Únltk.corpus.reader.utilr   r   r   Únltk.tokenizer   r   Únltk.translater	   r
   r   r$   r8   r    r   ú<module>rP      så   ðð 0Ð /Ð /Ð /Ð /Ð /ðð ð ð ð ð ð ð ð ð ð
 ?Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1ð]
ð ]
ð ]
ð ]
ð ]
˜,ñ ]
ô ]
ð ]
ð@(ð (ð (ð (ð (Ð2ñ (ô (ð (ð (ð (r    