+
    ÖÇÜh¥6  ã                   óœ   € R t ^ RIt^ RIt^ RIHt ^ RIHtHt ^ RIH	t	 R t
 ! R R]	4      t ! R R	4      t ! R
 R4      t ! R R]4      tR# )z9
A reader for corpora whose documents are in MTE format.
N)Úreduce)ÚTaggedCorpusReaderÚconcat)ÚXMLCorpusViewc                 ó$   € V P                  W4      # ©N)Úfindall)ÚrootÚpathÚnss   &&&Ú8/usr/lib/python3/dist-packages/nltk/corpus/reader/mte.pyÚxpathr      s   € Ø�<‰<˜Ó!Ð!ó    c                   ó8   a € ] tR t^t o RtRR ltRR ltRtV tR# )ÚMTECorpusViewz(
Class for lazy viewing the MTE Corpus.
Nc                ó4   € \         P                  ! WW#4       R # r   )r   Ú__init__)ÚselfÚfileidÚtagspecÚelt_handlers   &&&&r   r   ÚMTECorpusView.__init__   s   € Ü×Ò˜t¨WÖBr   c                óX   € \        \        R  \        P                  ! WW#4      4      4      # )c                 ó
   € V R J# r   © ©Úxs   &r   Ú<lambda>Ú*MTECorpusView.read_block.<locals>.<lambda>   ó   € ˜! 4™-r   )ÚlistÚfilterr   Ú
read_block)r   Ústreamr   r   s   &&&&r   r"   ÚMTECorpusView.read_block   s*   € ÜÜÙ'Ü×(Ò(¨°wÓLóó
ð 	
r   r   r   )NN)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r"   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r      s   ø‡ € ñôC÷
ò 
r   r   c                   ó  a € ] tR t^"t o RtRRRR/tRtRtRtR	t	R
t
R t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       tR tR tR tR tR tR tR tR tR tRtV t R# ) ÚMTEFileReaderz™
Class for loading the content of the multext-east corpus. It
parses the xml files and does some tag-filtering depending on the
given method parameters.
Úteizhttps://www.tei-c.org/ns/1.0Úxmlz%https://www.w3.org/XML/1998/namespacez{https://www.tei-c.org/ns/1.0}z'{https://www.w3.org/XML/1998/namespace}zTEI/text/body/div/div/p/s/(w|c)zTEI/text/body/div/div/p/szTEI/text/body/div/div/pc                ó   € Wn         R # r   )Ú_MTEFileReader__file_path)r   Ú	file_paths   &&r   r   ÚMTEFileReader.__init__3   s   € Ø$Ör   c                ó   € VP                   # r   )Útext©ÚclsÚeltÚcontexts   &&&r   Ú	_word_eltÚMTEFileReader._word_elt6   s   € à�x‰xˆr   c                óx   € \        VR V P                  4       Uu. uF  q0P                  VR4      NK  	  up# u upi ©Ú*N)r   r   r<   ©r9   r:   r;   Úws   &&& r   Ú	_sent_eltÚMTEFileReader._sent_elt:   ó2   € ä05°c¸3ÀÇÁÔ0GÓHÑ0G¨1—‘˜a Ö&Ñ0GÑHÐHùÒHó   š7c                óx   € \        VR V P                  4       Uu. uF  q0P                  VR4      NK  	  up# u upi r?   )r   r   rC   ©r9   r:   r;   Úss   &&& r   Ú	_para_eltÚMTEFileReader._para_elt>   rE   rF   c                ó
  € R VP                   9  d   VP                  R3# V P                  R8X  d1   V P                  R8X  d    VP                  VP                   R ,          3# V P                  R8X  dD   V P                  R8X  d3   VP                  \        P                  VP                   R ,          4      3# \        P                  ! R\        P                  ! RRV P                  4      ,           R,           4      pVP                  VP                   R ,          4      '       dc   V P                  R8X  d    VP                  VP                   R ,          3# VP                  \        P                  VP                   R ,          4      3# R# )	ÚanaÚ ÚmsdÚ	universalÚ^Ú-Ú.z.*$N)
Úattribr7   Ú_MTEFileReader__tagsÚ_MTEFileReader__tagsetÚMTETagConverterÚmsd_to_universalÚreÚcompileÚsubÚmatch)r9   r:   r;   Útagss   &&& r   Ú_tagged_word_eltÚMTEFileReader._tagged_word_eltB   s  € à˜Ÿ
™
Ô"Ø—H‘H˜b�>Ð!à�:‰:˜Ô §¡°Ô 5Ø—H‘H˜cŸj™j¨Õ/Ð0Ð0Ø�Z‰Z˜2Ô #§,¡,°+Ô"=Ø—H‘Hœo×>Ñ>¸s¿z¹zÈ%Õ?PÓQÐRÐRä—:’:˜c¤B§F¢F¨3°°S·Z±ZÓ$@Õ@À5ÕHÓIˆDØ�z‰z˜#Ÿ*™* UÕ+×,Ò,Ø—<‘< 5Ô(ØŸH™H c§j¡j°Õ&7Ð8Ð8ð Ÿ™Ü'×8Ñ8¸¿¹ÀEÕ9JÓKðð ñ
 r   c                ó    € \        \        R  \        VRV P                  4       Uu. uF  q0P	                  VR4      NK  	  up4      4      # u upi )c                 ó
   € V R J# r   r   r   s   &r   r   Ú0MTEFileReader._tagged_sent_elt.<locals>.<lambda>\   r   r   r@   N)r    r!   r   r   r^   rA   s   &&& r   Ú_tagged_sent_eltÚMTEFileReader._tagged_sent_eltX   óL   € äÜÙ'Ü8=¸cÀ3ÈÏÉÔ8OÓPÑ8O°1×%Ñ% a¨Ö.Ñ8OÑPóó
ð 	
ùò Qó   ¦Ac                ó    € \        \        R  \        VRV P                  4       Uu. uF  q0P	                  VR4      NK  	  up4      4      # u upi )c                 ó
   € V R J# r   r   r   s   &r   r   Ú0MTEFileReader._tagged_para_elt.<locals>.<lambda>e   r   r   r@   N)r    r!   r   r   rc   rH   s   &&& r   Ú_tagged_para_eltÚMTEFileReader._tagged_para_elta   re   rf   c                ó~   € R VP                   9  d   VP                  R3# VP                  VP                   R ,          3# )ÚlemmarN   )rT   r7   r8   s   &&&r   Ú_lemma_word_eltÚMTEFileReader._lemma_word_eltj   s4   € à˜#Ÿ*™*Ô$Ø—H‘H˜b�>Ð!à—H‘H˜cŸj™j¨Õ1Ð2Ð2r   c                óx   € \        VR V P                  4       Uu. uF  q0P                  VR4      NK  	  up# u upi r?   )r   r   rn   rA   s   &&& r   Ú_lemma_sent_eltÚMTEFileReader._lemma_sent_eltq   ó4   € ä6;¸CÀÀcÇfÁfÔ6MÓNÑ6M°×#Ñ# A tÖ,Ñ6MÑNÐNùÒNrF   c                óx   € \        VR V P                  4       Uu. uF  q0P                  VR4      NK  	  up# u upi r?   )r   r   rq   rH   s   &&& r   Ú_lemma_para_eltÚMTEFileReader._lemma_para_eltu   rs   rF   c                óh   € \        V P                  \        P                  \        P                  4      # r   )r   r3   r/   Ú	word_pathr<   ©r   s   &r   ÚwordsÚMTEFileReader.wordsy   ó(   € ÜØ×Ñœm×5Ñ5´}×7NÑ7Nó
ð 	
r   c                óh   € \        V P                  \        P                  \        P                  4      # r   )r   r3   r/   Ú	sent_pathrC   ry   s   &r   ÚsentsÚMTEFileReader.sents~   r|   r   c                óh   € \        V P                  \        P                  \        P                  4      # r   )r   r3   r/   Ú	para_pathrJ   ry   s   &r   ÚparasÚMTEFileReader.parasƒ   r|   r   c                óh   € \        V P                  \        P                  \        P                  4      # r   )r   r3   r/   rx   rn   ry   s   &r   Úlemma_wordsÚMTEFileReader.lemma_wordsˆ   ó(   € ÜØ×Ñœm×5Ñ5´}×7TÑ7Tó
ð 	
r   c                ó”   € V\         n        V\         n        \        V P                  \         P
                  \         P                  4      # r   )r/   rV   rU   r   r3   rx   r^   ©r   Útagsetr]   s   &&&r   Útagged_wordsÚMTEFileReader.tagged_words�   ó8   € Ø!'ŒÔØ#ŒÔÜØ×Ñœm×5Ñ5´}×7UÑ7Uó
ð 	
r   c                óh   € \        V P                  \        P                  \        P                  4      # r   )r   r3   r/   r~   rq   ry   s   &r   Úlemma_sentsÚMTEFileReader.lemma_sents”   rˆ   r   c                ó”   € V\         n        V\         n        \        V P                  \         P
                  \         P                  4      # r   )r/   rV   rU   r   r3   r~   rc   rŠ   s   &&&r   Útagged_sentsÚMTEFileReader.tagged_sents™   rŽ   r   c                óh   € \        V P                  \        P                  \        P                  4      # r   )r   r3   r/   r‚   ru   ry   s   &r   Úlemma_parasÚMTEFileReader.lemma_paras    rˆ   r   c                ó”   € V\         n        V\         n        \        V P                  \         P
                  \         P                  4      # r   )r/   rV   rU   r   r3   r‚   rj   rŠ   s   &&&r   Útagged_parasÚMTEFileReader.tagged_paras¥   rŽ   r   )Ú__file_pathN)!r%   r&   r'   r(   r)   r   Útag_nsÚxml_nsrx   r~   r‚   r   Úclassmethodr<   rC   rJ   r^   rc   rj   rn   rq   ru   rz   r   rƒ   r†   rŒ   r�   r“   r–   r™   r*   r+   r,   s   @r   r/   r/   "   s-  ø‡ € ñð 	Ð-ØÐ6ð
€Bð .€FØ6€FØ1€IØ+€IØ)€Iò%ð ñó ðð ñIó ðIð ñIó ðIð ñó ðð* ñ
ó ð
ð ñ
ó ð
ð ñ3ó ð3ð ñOó ðOð ñOó ðOò
ò

ò

ò

ò

ò
ò

ò
÷

ð 
r   r/   c                   óh   a € ] tR t^­t o RtRRRRRRRR	R
RRRRRRRRRRRRRRR/t]R 4       tRtV t	R# )rW   zi
Class for converting msd tags to universal tags, more conversion
options are currently not implemented.
ÚAÚADJÚSÚADPÚRÚADVÚCÚCONJÚDÚDETÚNÚNOUNÚMÚNUMÚQÚPRTÚPÚPRONÚVÚVERBrS   rR   ÚXc                óž   € V ^ ,          R8X  g
   V ^ ,          MV ^,          pV\         P                  9   g   Rp\         P                  V,          # )zÖ
This function converts the annotation from the Multex-East to the universal tagset
as described in Chapter 5 of the NLTK-Book

Unknown Tags will be mapped to X. Punctuation marks are not supported in MSD tags, so
Ú#rR   )rW   Úmapping_msd_universal)ÚtagÚ	indicators   & r   rX   Ú MTETagConverter.msd_to_universalÂ   sA   € ð #& a¥&¨C¤-�C˜–F°S¸µVˆ	àœO×AÑAÔAØˆIä×4Ñ4°YÕ?Ð?r   r   N)
r%   r&   r'   r(   r)   r·   ÚstaticmethodrX   r*   r+   r,   s   @r   rW   rW   ­   sf   ø‡ € ñð 	ˆUØˆUØˆUØˆVØˆUØˆVØˆUØˆUØˆVØˆVØˆSØˆSðÐð ñ@ó ö@r   rW   c                   óŽ   a € ] tR t^Òt o RtRR ltR 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V tR# )ÚMTECorpusReaderzÖ
Reader for corpora following the TEI-p5 xml scheme, such as MULTEXT-East.
MULTEXT-East contains part-of-speech-tagged words with a quite precise tagging
scheme. These tags can be converted to the Universal tagset
Nc                óB   € \         P                  ! WW#4       RV n        R# )aî  
Construct a new MTECorpusreader for a set of documents
located at the given root directory.  Example usage:

    >>> root = '/...path to corpus.../'
    >>> reader = MTECorpusReader(root, 'oana-*.xml', 'utf8') # doctest: +SKIP

:param root: The root directory for this corpus. (default points to location in multext config file)
:param fileids: A list or regexp specifying the fileids in this corpus. (default is oana-en.xml)
:param encoding: The encoding of the given files (default is utf8)
z00README.txtN)r   r   Ú_readme)r   r	   ÚfileidsÚencodings   &&&&r   r   ÚMTECorpusReader.__init__Ù   s   € ô 	×#Ò# D°ÔBØ%ˆŽr   c                ó¼   a € Vf   S P                   pM\        V\        4      '       d   V.p\        V 3R lV4      p\        R V4      pV'       g   \	        R4       V# )Nc                 ó"   <€ V SP                   9   # r   )Ú_fileids)r   r   s   &€r   r   Ú+MTECorpusReader.__fileids.<locals>.<lambda>î   s   ø€  1¨¯©Ò#5r   c                 ó   € V R9  # )úoana-bg.xml)rÈ   zoana-mk.xmlr   r   s   &r   r   rÆ   ð   s
   €  1Ð,JÒ#Jr   z$No valid multext-east file specified)rÅ   Ú
isinstanceÚstrr!   Úprint)r   rÀ   s   f&r   Ú	__fileidsÚMTECorpusReader.__fileidsè   sP   ø€ ØŠ?Ø—m‘m‰GÜ˜¤×%Ò%Ø�iˆGäÔ5°wÓ?ˆäÑJÈGÓTˆßÜÐ8Ô9Øˆr   c                óÞ   € \        V P                  V4       Uu. uFD  p\        \        P                  P                  V P                  V4      4      P                  4       NKF  	  up4      # u upi )z�
:param fileids: A list specifying the fileids that should be used.
:return: the given file(s) as a list of words and punctuation symbols.
:rtype: list(str)
)r   Ú_MTECorpusReader__fileidsr/   Úosr
   ÚjoinÚ_rootrz   ©r   rÀ   Úfs   && r   rz   ÚMTECorpusReader.wordsõ   s]   € ô ð Ÿ™¨Ô0óá0�Aô œbŸg™gŸl™l¨4¯:©:°qÓ9Ó:×@Ñ@ÖBÙ0ñó
ð 	
ùòó   ™A
A*c                óÞ   € \        V P                  V4       Uu. uFD  p\        \        P                  P                  V P                  V4      4      P                  4       NKF  	  up4      # u upi )zÍ
:param fileids: A list specifying the fileids that should be used.
:return: the given file(s) as a list of sentences or utterances,
         each encoded as a list of word strings
:rtype: list(list(str))
)r   rÏ   r/   rÐ   r
   rÑ   rÒ   r   rÓ   s   && r   r   ÚMTECorpusReader.sents  ó]   € ô ð Ÿ™¨Ô0óá0�Aô œbŸg™gŸl™l¨4¯:©:°qÓ9Ó:×@Ñ@ÖBÙ0ñó
ð 	
ùòrÖ   c                óÞ   € \        V P                  V4       Uu. uFD  p\        \        P                  P                  V P                  V4      4      P                  4       NKF  	  up4      # u upi )zö
:param fileids: A list specifying the fileids that should be used.
: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 string
:rtype: list(list(list(str)))
)r   rÏ   r/   rÐ   r
   rÑ   rÒ   rƒ   rÓ   s   && r   rƒ   ÚMTECorpusReader.paras  rÙ   rÖ   c                óÞ   € \        V P                  V4       Uu. uFD  p\        \        P                  P                  V P                  V4      4      P                  4       NKF  	  up4      # u upi )zë
:param fileids: A list specifying the fileids that should be used.
:return: the given file(s) as a list of words, the corresponding lemmas
         and punctuation symbols, encoded as tuples (word, lemma)
:rtype: list(tuple(str,str))
)r   rÏ   r/   rÐ   r
   rÑ   rÒ   r†   rÓ   s   && r   r†   ÚMTECorpusReader.lemma_words  s]   € ô ð Ÿ™¨Ô0óá0�Aô œbŸg™gŸl™l¨4¯:©:°qÓ9Ó:×FÑFÖHÙ0ñó
ð 	
ùòrÖ   c                ó  € VR8X  g   VR8X  dk   \        V P                  V4       Uu. uFE  p\        \        P                  P                  V P                  V4      4      P                  W#4      NKG  	  up4      # \        R4       R# u upi )aó  
:param fileids: A list specifying the fileids that should be used.
:param tagset: The tagset that should be used in the returned object,
               either "universal" or "msd", "msd" is the default
:param tags: An MSD Tag that is used to filter all parts of the used corpus
             that are not more precise or at least equal to the given tag
:return: the given file(s) as a list of tagged words and punctuation symbols
         encoded as tuples (word, tag)
:rtype: list(tuple(str, str))
rP   rO   úUnknown tagset specified.N)	r   rÏ   r/   rÐ   r
   rÑ   rÒ   rŒ   rË   ©r   rÀ   r‹   r]   rÔ   s   &&&& r   rŒ   ÚMTECorpusReader.tagged_words,  ó   € ð �[Ô  F¨e¤OÜð
 "Ÿ^™^¨GÔ4ó	ñ 5˜ô "¤"§'¡'§,¡,¨t¯z©z¸1Ó"=Ó>×KÑKØöñ 5ñ	óð ô Ð-Ö.ùòó   §ABc                óÞ   € \        V P                  V4       Uu. uFD  p\        \        P                  P                  V P                  V4      4      P                  4       NKF  	  up4      # u upi )a  
:param fileids: A list specifying the fileids that should be used.
:return: the given file(s) as a list of sentences or utterances, each
         encoded as a list of tuples of the word and the corresponding
         lemma (word, lemma)
:rtype: list(list(tuple(str, str)))
)r   rÏ   r/   rÐ   r
   rÑ   rÒ   r�   rÓ   s   && r   r�   ÚMTECorpusReader.lemma_sentsC  ó]   € ô ð Ÿ™¨Ô0óá0�Aô œbŸg™gŸl™l¨4¯:©:°qÓ9Ó:×FÑFÖHÙ0ñó
ð 	
ùòrÖ   c                ó  € VR8X  g   VR8X  dk   \        V P                  V4       Uu. uFE  p\        \        P                  P                  V P                  V4      4      P                  W#4      NKG  	  up4      # \        R4       R# u upi )a   
:param fileids: A list specifying the fileids that should be used.
:param tagset: The tagset that should be used in the returned object,
               either "universal" or "msd", "msd" is the default
:param tags: An MSD Tag that is used to filter all parts of the used corpus
             that are not more precise or at least equal to the given tag
:return: the given file(s) as a list of sentences or utterances, each
         each encoded as a list of (word,tag) tuples
:rtype: list(list(tuple(str, str)))
rP   rO   rß   N)	r   rÏ   r/   rÐ   r
   rÑ   rÒ   r“   rË   rà   s   &&&& r   r“   ÚMTECorpusReader.tagged_sentsR  râ   rã   c                óÞ   € \        V P                  V4       Uu. uFD  p\        \        P                  P                  V P                  V4      4      P                  4       NKF  	  up4      # u upi )a=  
:param fileids: A list specifying the fileids that should be used.
:return: the given file(s) as a list of paragraphs, each encoded as a
         list of sentences, which are in turn encoded as a list of
         tuples of the word and the corresponding lemma (word, lemma)
:rtype: list(List(List(tuple(str, str))))
)r   rÏ   r/   rÐ   r
   rÑ   rÒ   r–   rÓ   s   && r   r–   ÚMTECorpusReader.lemma_parasi  ræ   rÖ   c                ó  € VR8X  g   VR8X  dk   \        V P                  V4       Uu. uFE  p\        \        P                  P                  V P                  V4      4      P                  W#4      NKG  	  up4      # \        R4       R# u upi )a/  
:param fileids: A list specifying the fileids that should be used.
:param tagset: The tagset that should be used in the returned object,
               either "universal" or "msd", "msd" is the default
:param tags: An MSD Tag that is used to filter all parts of the used corpus
             that are not more precise or at least equal to the given tag
:return: the given file(s) as a list of paragraphs, each encoded as a
         list of sentences, which are in turn encoded as a list
         of (word,tag) tuples
:rtype: list(list(list(tuple(str, str))))
rP   rO   rß   N)	r   rÏ   r/   rÐ   r
   rÑ   rÒ   r™   rË   rà   s   &&&& r   r™   ÚMTECorpusReader.tagged_parasx  s   € ð �[Ô  F¨e¤OÜð
 "Ÿ^™^¨GÔ4ó	ñ 5˜ô "¤"§'¡'§,¡,¨t¯z©z¸1Ó"=Ó>×KÑKØöñ 5ñ	óð ô Ð-Ö.ùòrã   )r¿   )NNÚutf8r   )NrO   rN   )r%   r&   r'   r(   r)   r   rÏ   rz   r   rƒ   r†   rŒ   r�   r“   r–   r™   r*   r+   r,   s   @r   r½   r½   Ò   sF   ø‡ € ñô&òô
ô
ô
ô
ô/ô.
ô/ô.
÷/ò /r   r½   )r)   rÐ   rY   Ú	functoolsr   Únltk.corpus.readerr   r   Únltk.corpus.reader.xmldocsr   r   r   r/   rW   r½   r   r   r   Ú<module>rñ      sU   ðñó 
Û 	Ý ç 9Ý 4ò"ô
�Mô 
÷"H
ñ H
÷V"@ñ "@ôJ|/Ð(ö |/r   