+
    ÖÇÜh…#  ã                   ó�   € R t ^ RIt^ RIt^ RIt^ RIHt ^ RI5 ^ RIH	t	 ^ RI
5 ^ RI5 ^ RIHt  ! R R]4      t ! R R	]4      tR# )
zN
A reader for corpora that contain chunked (and optionally tagged)
documents.
N)Útagstr2tree)Ú*)ÚBracketParseCorpusReader)ÚTreec                   óª   a € ] tR t^t o RtR]]! RRR7      ]RR3R l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R ltRR ltRR ltR tRtV tR# )ÚChunkedCorpusReadera  
Reader for chunked (and optionally tagged) corpora.  Paragraphs
are split using a block reader.  They are then tokenized into
sentences using a sentence tokenizer.  Finally, these sentences
are parsed into chunk trees using a string-to-chunktree conversion
function.  Each of these steps can be performed using a default
function or a custom function.  By default, paragraphs are split
on blank lines; sentences are listed one per line; and sentences
are parsed into chunk trees using ``nltk.chunk.tagstr2tree``.
Ú Ú
T)ÚgapsÚutf8Nc	                óD   € \         P                  WW'4       WEWh3V n        R# )zz
:param root: The root directory for this corpus.
:param fileids: A list or regexp specifying the fileids in this corpus.
N)ÚCorpusReaderÚ__init__Ú_cv_args)	ÚselfÚrootÚfileidsÚ	extensionÚstr2chunktreeÚsent_tokenizerÚpara_block_readerÚencodingÚtagsets	   &&&&&&&&&Ú</usr/lib/python3/dist-packages/nltk/corpus/reader/chunked.pyr   ÚChunkedCorpusReader.__init__&   s'   € ô 	×Ñ˜d¨'Ô<Ø&Ð8IÐRˆŒñ	Aó    c                óž   € \        V P                  VR4       UUu. uF   w  r#\        W#^ ^ ^ ^ .V P                  O5!  NK"  	  upp4      # u uppi )z^
:return: the given file(s) as a list of words
    and punctuation symbols.
:rtype: list(str)
T©ÚconcatÚabspathsÚChunkedCorpusViewr   ©r   r   ÚfÚencs   &&  r   ÚwordsÚChunkedCorpusReader.words:   sV   € ô ð !%§¡¨g°tÔ <ôá <‘H�Qô " !¨!¨Q°°1ÐE°t·}±}ÖEÙ <òó
ð 	
ùóó   ›&A	
c                óž   € \        V P                  VR4       UUu. uF   w  r#\        W#^ ^^ ^ .V P                  O5!  NK"  	  upp4      # u uppi )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))
Tr   r!   s   &&  r   ÚsentsÚChunkedCorpusReader.sentsG   óV   € ô ð !%§¡¨g°tÔ <ôá <‘H�Qô " !¨!¨Q°°1ÐE°t·}±}ÖEÙ <òó
ð 	
ùór&   c                óž   € \        V P                  VR4       UUu. uF   w  r#\        W#^ ^^^ .V P                  O5!  NK"  	  upp4      # u uppi )z´
:return: the given file(s) as a list of
    paragraphs, each encoded as a list of sentences, which are
    in turn encoded as lists of word strings.
:rtype: list(list(list(str)))
Tr   r!   s   &&  r   ÚparasÚChunkedCorpusReader.parasU   r*   r&   c                ó¢   € \        V P                  VR4       UUu. uF"  w  r4\        W4^^ ^ ^ .V P                  O5RV/ NK$  	  upp4      # u uppi )z–
:return: the given file(s) as a list of tagged
    words and punctuation symbols, encoded as tuples
    ``(word,tag)``.
:rtype: list(tuple(str,str))
TÚtarget_tagsetr   ©r   r   r   r"   r#   s   &&&  r   Útagged_wordsÚ ChunkedCorpusReader.tagged_wordsc   óh   € ô ð
 !%§¡¨g°tÔ <ô	ñ !=‘H�Qô "Ø˜A˜q ! QðØ)-¯©òØFLôñ !=ò	ó
ð 	
ùóó   ›(A
c                ó¢   € \        V P                  VR4       UUu. uF"  w  r4\        W4^^^ ^ .V P                  O5RV/ NK$  	  upp4      # u uppi )z�
:return: the given file(s) as a list of
    sentences, each encoded as a list of ``(word,tag)`` tuples.

:rtype: list(list(tuple(str,str)))
Tr/   r   r0   s   &&&  r   Útagged_sentsÚ ChunkedCorpusReader.tagged_sentss   r3   r4   c                ó¢   € \        V P                  VR4       UUu. uF"  w  r4\        W4^^^^ .V P                  O5RV/ NK$  	  upp4      # u uppi )zÈ
:return: the given file(s) as a list of
    paragraphs, each encoded as a list of sentences, which are
    in turn encoded as lists of ``(word,tag)`` tuples.
:rtype: list(list(list(tuple(str,str))))
Tr/   r   r0   s   &&&  r   Útagged_parasÚ ChunkedCorpusReader.tagged_parasƒ   r3   r4   c                ó¢   € \        V P                  VR4       UUu. uF"  w  r4\        W4^^ ^ ^.V P                  O5RV/ NK$  	  upp4      # u uppi )a>  
:return: the given file(s) as a list of tagged
    words and chunks.  Words are encoded as ``(word, tag)``
    tuples (if the corpus has tags) or word strings (if the
    corpus has no tags).  Chunks are encoded as depth-one
    trees over ``(word,tag)`` tuples or word strings.
:rtype: list(tuple(str,str) and Tree)
Tr/   r   r0   s   &&&  r   Úchunked_wordsÚ!ChunkedCorpusReader.chunked_words“   óh   € ô ð
 !%§¡¨g°tÔ <ô	ñ !=‘H�Qô "Ø˜A˜q ! QðØ)-¯©òØFLôñ !=ò	ó
ð 	
ùór4   c                ó¢   € \        V P                  VR4       UUu. uF"  w  r4\        W4^^^ ^.V P                  O5RV/ NK$  	  upp4      # u uppi )zþ
:return: the given file(s) as a list of
    sentences, each encoded as a shallow Tree.  The leaves
    of these trees are encoded as ``(word, tag)`` tuples (if
    the corpus has tags) or word strings (if the corpus has no
    tags).
:rtype: list(Tree)
Tr/   r   r0   s   &&&  r   Úchunked_sentsÚ!ChunkedCorpusReader.chunked_sents¥   r>   r4   c                ó¢   € \        V P                  VR4       UUu. uF"  w  r4\        W4^^^^.V P                  O5RV/ NK$  	  upp4      # u uppi )a7  
:return: the given file(s) as a list of
    paragraphs, each encoded as a list of sentences, which are
    in turn encoded as a shallow Tree.  The leaves of these
    trees are encoded as ``(word, tag)`` tuples (if the corpus
    has tags) or word strings (if the corpus has no tags).
:rtype: list(list(Tree))
Tr/   r   r0   s   &&&  r   Úchunked_parasÚ!ChunkedCorpusReader.chunked_paras·   r>   r4   c                óT   € \        V4       Uu. uF  p\        V4      NK  	  up# u upi ©N)Úread_blankline_blockr   )r   ÚstreamÚts   && r   Ú_read_blockÚChunkedCorpusReader._read_blockÉ   s%   € Ü(<¸VÔ(DÓEÑ(D 1”˜A–Ñ(DÑEÐEùÒEs   Ž%)r   rF   ©NN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚRegexpTokenizerrG   r   r$   r(   r,   r1   r6   r9   r<   r@   rC   rJ   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r      sd   ø‡ € ñ	ð Ø!Ù& t°$Ô7Ø.ØØôAô(
ô
ô
ô
ô 
ô 
ô 
ô$
ô$
÷$Fð Fr   r   c                   ó6   a € ] tR t^Ít o RR ltR tR tRtV tR# )r    Nc                ó    € \         P                  WVR 7       W0n        W@n        WPn        W`n        Wpn        W€n        W�n        W n	        W°n
        R# ))r   N)ÚStreamBackedCorpusViewr   Ú_taggedÚ_group_by_sentÚ_group_by_paraÚ_chunkedÚ_str2chunktreeÚ_sent_tokenizerÚ_para_block_readerÚ_source_tagsetÚ_target_tagset)r   Úfileidr   ÚtaggedÚgroup_by_sentÚgroup_by_paraÚchunkedr   r   r   Úsource_tagsetr/   s   &&&&&&&&&&&&r   r   ÚChunkedCorpusView.__init__Î   sK   € ô 	×'Ñ'¨¸xÐ'ÔHØŒØ+ÔØ+ÔØŒØ+ÔØ-ÔØ"3ÔØ+ÔØ+Ör   c                ó8  € . pV P                  V4       EF  p. pV P                  P                  V4       F¦  pV P                  VV P                  V P
                  R 7      pV P                  '       g   V P                  V4      pV P                  '       g   VP                  4       pV P                  '       d   VP                  V4       K•  VP                  V4       K¨  	  V P                  '       d   VP                  V4       Kð  VP                  V4       EK  	  V# ))rh   r/   )r`   r_   Útokenizer^   ra   rb   rZ   Ú_untagr]   Úleavesr[   ÚappendÚextendr\   )r   rH   ÚblockÚpara_strÚparaÚsent_strÚsents   &&     r   Ú
read_blockÚChunkedCorpusView.read_blockç   sé   € ØˆØ×/Ñ/°×7ˆHØˆDØ ×0Ñ0×9Ñ9¸(ÖC�Ø×*Ñ*ØØ"&×"5Ñ"5Ø"&×"5Ñ"5ð +ó �ð —|—|�|ØŸ;™; tÓ,�Dð —}—}�}ØŸ;™;›=�Dð ×&×&Ð&Ø—K‘K Ö%à—K‘K Ö%ñ' Dð, ×"×"Ð"Ø—‘˜TÖ"à—‘˜T×"ñ7 8ð< ˆr   c                óØ   € \        V4       FZ  w  r#\        V\        4      '       d   V P                  V4       K.  \        V\        4      '       d   V^ ,          W&   KQ  \        R4      h	  V# )é    z"expected child to be Tree or tuple)Ú	enumerateÚ
isinstancer   rl   ÚtupleÚ
ValueError)r   ÚtreeÚiÚchilds   &&  r   rl   ÚChunkedCorpusView._untag	  sV   € Ü! $ž‰HˆAÜ˜%¤×&Ò&Ø—‘˜EÖ"Ü˜E¤5×)Ò)Ø �(�“ä Ð!EÓFÐFñ (ð ˆr   )	r]   r\   r[   r`   r_   ra   r^   rZ   rb   rL   )	rM   rN   rO   rP   r   ru   rl   rS   rT   rU   s   @r   r    r    Í   s   ø‡ € ô,ò2 ÷Dð r   r    )rQ   ÚcodecsÚos.pathÚosÚnltkÚ
nltk.chunkr   Únltk.corpus.reader.apiÚ nltk.corpus.reader.bracket_parser   Únltk.corpus.reader.utilÚnltk.tokenizeÚ	nltk.treer   r   r   rY   r    © r   r   Ú<module>rŒ      sG   ðñó
 Û ã Ý "Ü $Ý EÜ %Ü Ý ôpF˜,ô pFôfDÐ.ö Dr   