§
    'ê[f)  ã                   óØ  — d Z ddlZddlZddlT ddlmZ ddlmZ ddlT ddl	m
Z
  G d„ de¦  «        Z G d	„ d
e¦  «        Z G d„ de¦  «        Zi dd“dd“dd“dd“dd“dd“dd“dd“dd“dd “d!d"“d#d$“d%d&“d'd(“d)d*“d+d,“d-d.“i d/d0“d1d2“d3d4“d5d6“d7d8“d9d:“d;d<“d=d>“d?d@“dAdB“dCdD“dEdF“dGdH“dIdJ“dKdL“dMdN“dOdN“¥i dPdQ“dRdS“dTdU“dVdW“dXdY“dZd[“d\d]“d^d_“d`da“dbdc“ddde“dfdg“dhdi“djdk“dldm“dndo“dpdq“¥i drds“dtdu“dvdw“dxdy“dzd{“d|d}“d~d“d€d�“d‚dƒ“d„d…“d†d‡“dˆd‰“dŠd‹“dŒd�“dŽd�“d�d‘“d’d““¥i d”d•“d–d—“d˜d™“dšd›“dœd�“dždŸ“d d¡“d¢d£“d¤d¥“d¦d§“d¨d©“dªd«“d¬d­“d®d¯“d°d±“d²d³“d´dµ“¥d¶d·d¸d¹dºd»d¼d½d¾d¿dÀdÁdÂdÃdÄdÅœ¥ZdS )Æaß  
Corpus reader for the York-Toronto-Helsinki Parsed Corpus of Old
English Prose (YCOE), a 1.5 million word syntactically-annotated
corpus of Old English prose texts. The corpus is distributed by the
Oxford Text Archive: http://www.ota.ahds.ac.uk/ It is not included
with NLTK.

The YCOE corpus is divided into 100 files, each representing
an Old English prose text. Tags used within each text complies
to the YCOE standard: https://www-users.york.ac.uk/~lang22/YCOE/YcoeHome.htm
é    N)Ú*)ÚBracketParseCorpusReader)ÚTaggedCorpusReader)ÚRegexpTokenizerc                   óh   — e Zd ZdZdd„Zdd„Zdd„Zd„ Zdd„Zdd	„Z	dd
„Z
dd„Zdd„Zdd„Zdd„ZdS )ÚYCOECorpusReaderz¶
    Corpus reader for the York-Toronto-Helsinki Parsed Corpus of Old
    English Prose (YCOE), a 1.5 million word syntactically-annotated
    corpus of Old English prose texts.
    Úutf8c                 ó\  — t                                | |g |¦  «         t          | j                             d¦  «        dd|¬¦  «        | _        t          | j                             d¦  «        dd¦  «        | _        d„ | j                             ¦   «         D ¦   «         }d„ | j                             ¦   «         D ¦   «         |k    rt          d	¦  «        ‚t          d
„ |D ¦   «         d„ |D ¦   «         z   ¦  «        }t                                | |||¦  «         t          |¦  «        | _        d S )NÚpsdz.*ú.psd)ÚencodingÚposú.posc                 ó"   — h | ]}|d d…         ’ŒS ©Néüÿÿÿ© ©Ú.0Úfs     úK/var/www/piapp/venv/lib/python3.11/site-packages/nltk/corpus/reader/ycoe.pyú	<setcomp>z,YCOECorpusReader.__init__.<locals>.<setcomp>.   s    € Ð@Ð@Ð@ �Q�s˜�s”VÐ@Ð@Ð@ó    c                 ó"   — h | ]}|d d…         ’ŒS r   r   r   s     r   r   z,YCOECorpusReader.__init__.<locals>.<setcomp>/   s    € Ð7Ð7Ð7�qˆAˆcˆrˆcŒFÐ7Ð7Ð7r   z5Items in "psd" and "pos" subdirectories do not match.c                 ó   — g | ]}d |z  ‘ŒS ©z%s.psdr   ©r   Údocs     r   ú
<listcomp>z-YCOECorpusReader.__init__.<locals>.<listcomp>3   s   € Ð1Ð1Ð1 ˆX˜‰^Ð1Ð1Ð1r   c                 ó   — g | ]}d |z  ‘ŒS ©z%s.posr   r   s     r   r   z-YCOECorpusReader.__init__.<locals>.<listcomp>4   s   € Ð3Ð3Ð3 #ˆx˜#‰~Ð3Ð3Ð3r   )ÚCorpusReaderÚ__init__ÚYCOEParseCorpusReaderÚrootÚjoinÚ_psd_readerÚYCOETaggedCorpusReaderÚ_pos_readerÚfileidsÚ
ValueErrorÚsortedÚ
_documents)Úselfr%   r   Ú	documentsr*   s        r   r#   zYCOECorpusReader.__init__%   s/  € Ý×Ò˜d D¨"¨hÑ7Ô7Ð7å0ØŒI�NŠN˜5Ñ!Ô! 4¨¸(ð
ñ 
ô 
ˆÔõ 2°$´)·.².ÀÑ2GÔ2GÈÈvÑVÔVˆÔð AÐ@ TÔ%5×%=Ò%=Ñ%?Ô%?Ð@Ñ@Ô@ˆ	Ø7Ð7˜DÔ,×4Ò4Ñ6Ô6Ð7Ñ7Ô7¸9ÒDÐDÝÐWÑXÔXÐXåØ1Ð1 yÐ1Ñ1Ô1Ø3Ð3¨Ð3Ñ3Ô3ñ4ñ
ô 
ˆõ 	×Ò˜d D¨'°8Ñ<Ô<Ð<Ý  Ñ+Ô+ˆŒˆˆr   Nc                 ó¶   — |€| j         S t          |t          ¦  «        r|g}|D ]}|| j        vrt	          d|z  ¦  «        ‚Œt          d„ |D ¦   «         ¦  «        S )z£
        Return a list of document identifiers for all documents in
        this corpus, or for the documents with the given file(s) if
        specified.
        NzFile id %s not foundc                 ó"   — h | ]}|d d…         ’ŒS r   r   r   s     r   r   z-YCOECorpusReader.documents.<locals>.<setcomp>G   s    € Ð/Ð/Ð/ !�q˜˜"˜”vÐ/Ð/Ð/r   )r-   Ú
isinstanceÚstrÚ_fileidsÚKeyErrorr,   )r.   r*   r   s      r   r/   zYCOECorpusReader.documents9   s€   € ð ˆ?Ø”?Ð"Ý�g�sÑ#Ô#ð 	 Ø�iˆGØð 	Að 	AˆAØ˜œÐ%Ð%ÝÐ5¸Ñ?Ñ@Ô@Ð@ð &õ Ð/Ð/ wÐ/Ñ/Ô/Ñ0Ô0Ð0r   c                 óª   — |€| j         S t          |t          ¦  «        r|g}t          t	          d„ |D ¦   «         d„ |D ¦   «         z   ¦  «        ¦  «        S )z•
        Return a list of file identifiers for the files that make up
        this corpus, or that store the given document(s) if specified.
        Nc                 ó   — g | ]}d |z  ‘ŒS r!   r   r   s     r   r   z,YCOECorpusReader.fileids.<locals>.<listcomp>T   s   € Ð5Ð5Ð5 C�˜C‘Ð5Ð5Ð5r   c                 ó   — g | ]}d |z  ‘ŒS r   r   r   s     r   r   z,YCOECorpusReader.fileids.<locals>.<listcomp>U   s   € Ð7Ð7Ð7 c�8˜c‘>Ð7Ð7Ð7r   )r4   r2   r3   r,   Úset©r.   r/   s     r   r*   zYCOECorpusReader.fileidsI   sq   € ð
 ÐØ”=Ð Ý˜	¥3Ñ'Ô'ð 	$Ø"˜ˆIÝÝØ5Ð5¨9Ð5Ñ5Ô5Ø7Ð7¨YÐ7Ñ7Ô7ñ8ñô ñ
ô 
ð 	
r   c                 óÚ   ‡— |€| j         }nSt          |t          ¦  «        r|g}|D ]8}|| j         vr-|dd…         dv rt          d¦  «        ‚t          d|z  ¦  «        ‚Œ9ˆfd„|D ¦   «         S )z‡
        Helper that selects the appropriate fileids for a given set of
        documents from a given subcorpus (pos or psd).
        Nr   )r   r   zvExpected a document identifier, not a file identifier.  (Use corpus.documents() to get a list of document identifiers.z Document identifier %s not foundc                 ó   •— g | ]	}|› d ‰› �‘Œ
S )ú.r   )r   ÚdÚ	subcorpuss     €r   r   z0YCOECorpusReader._getfileids.<locals>.<listcomp>m   s'   ø€ Ð6Ð6Ð6 q�1Ð"Ð"�yÐ"Ð"Ð6Ð6Ð6r   )r-   r2   r3   r+   )r.   r/   r?   Údocuments     ` r   Ú_getfileidszYCOECorpusReader._getfileidsY   s­   ø€ ð
 ÐØœˆIˆIå˜)¥SÑ)Ô)ð (Ø&˜K�	Ø%ð 	Xð 	X�Ø 4¤?Ð2Ð2Ø   ”}Ð(8Ð8Ð8Ý(ð>ñô ð õ )Ð)KÈhÑ)VÑWÔWÐWð 3ð 7Ð6Ð6Ð6¨IÐ6Ñ6Ô6Ð6r   c                 ó^   — | j                              |                      |d¦  «        ¦  «        S ©Nr   )r)   ÚwordsrA   r:   s     r   rD   zYCOECorpusReader.wordsp   ó)   € ØÔ×%Ò% d×&6Ò&6°yÀ%Ñ&HÔ&HÑIÔIÐIr   c                 ó^   — | j                              |                      |d¦  «        ¦  «        S rC   )r)   ÚsentsrA   r:   s     r   rG   zYCOECorpusReader.sentss   rE   r   c                 ó^   — | j                              |                      |d¦  «        ¦  «        S rC   )r)   ÚparasrA   r:   s     r   rI   zYCOECorpusReader.parasv   rE   r   c                 ó^   — | j                              |                      |d¦  «        ¦  «        S rC   )r)   Útagged_wordsrA   r:   s     r   rK   zYCOECorpusReader.tagged_wordsy   ó)   € ØÔ×,Ò,¨T×-=Ò-=¸iÈÑ-OÔ-OÑPÔPÐPr   c                 ó^   — | j                              |                      |d¦  «        ¦  «        S rC   )r)   Útagged_sentsrA   r:   s     r   rN   zYCOECorpusReader.tagged_sents|   rL   r   c                 ó^   — | j                              |                      |d¦  «        ¦  «        S rC   )r)   Útagged_parasrA   r:   s     r   rP   zYCOECorpusReader.tagged_paras   rL   r   c                 ó^   — | j                              |                      |d¦  «        ¦  «        S )Nr   )r'   Úparsed_sentsrA   r:   s     r   rR   zYCOECorpusReader.parsed_sents‚   rL   r   ©r	   )N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r#   r/   r*   rA   rD   rG   rI   rK   rN   rP   rR   r   r   r   r   r      s  € € € € € ðð ð,ð ,ð ,ð ,ð(1ð 1ð 1ð 1ð 
ð 
ð 
ð 
ð 7ð 7ð 7ð.Jð Jð Jð JðJð Jð Jð JðJð Jð Jð JðQð Qð Qð QðQð Qð Qð QðQð Qð Qð QðQð Qð Qð Qð Qð Qr   r   c                   ó   — e Zd ZdZd„ ZdS )r$   zrSpecialized version of the standard bracket parse corpus reader
    that strips out (CODE ...) and (ID ...) nodes.c                 ó†   — t          j        dd|¦  «        }t          j        d|¦  «        rd S t          j        | |¦  «        S )Nz(?u)\((CODE|ID)[^\)]*\)Ú z\s*\(\s*\)\s*$)ÚreÚsubÚmatchr   Ú_parse)r.   Úts     r   r^   zYCOEParseCorpusReader._parseŠ   sC   € ÝŒFÐ-¨r°1Ñ5Ô5ˆÝŒ8Ð% qÑ)Ô)ð 	Ø�4Ý'Ô.¨t°QÑ7Ô7Ð7r   N)rT   rU   rV   rW   r^   r   r   r   r$   r$   †   s-   € € € € € ð6ð 6ð8ð 8ð 8ð 8ð 8r   r$   c                   ó   — e Zd Zdd„ZdS )r(   r	   c                 ó^   — d}t          |d¬¦  «        }t          j        | ||d|¬¦  «         d S )Nz+(?u)(?<=/\.)\s+|\s*\S*_CODE\s*|\s*\S*_ID\s*T)ÚgapsÚ_)ÚsepÚsent_tokenizer)r   r   r#   )r.   r%   Úitemsr   Úgaps_rere   s         r   r#   zYCOETaggedCorpusReader.__init__’   sH   € Ø@ˆÝ(¨°tÐ<Ñ<Ô<ˆÝÔ#Ø�$˜ 3°~ð	
ñ 	
ô 	
ð 	
ð 	
ð 	
r   NrS   )rT   rU   rV   r#   r   r   r   r(   r(   ‘   s(   € € € € € ð
ð 
ð 
ð 
ð 
ð 
r   r(   zcoadrian.o34zAdrian and Ritheuszcoaelhom.o3u   Ã†lfric, Supplemental Homilieszcoaelive.o3u   Ã†lfric's Lives of SaintsÚcoalcuinzAlcuin De virtutibus et vitiisz
coalex.o23zAlexander's Letter to Aristotlezcoapollo.o3zApollonius of TyreÚcoaugustÚ	Augustinez	cobede.o2z$Bede's History of the English Churchzcobenrul.o3zBenedictine Rulezcoblick.o23zBlickling Homiliesz
coboeth.o2z#Boethius' Consolation of Philosophyzcobyrhtf.o3zByrhtferth's ManualÚ	cocanedgDzCanons of Edgar (D)Ú	cocanedgXzCanons of Edgar (X)zcocathom1.o3u   Ã†lfric's Catholic Homilies Izcocathom2.o3u   Ã†lfric's Catholic Homilies IIz
cochad.o24z
Saint ChadÚcochdrulzChrodegang of Metz, RuleÚcochristophzSaint ChristopherzcochronA.o23zAnglo-Saxon Chronicle AÚcochronCzAnglo-Saxon Chronicle CÚcochronDzAnglo-Saxon Chronicle DzcochronE.o34zAnglo-Saxon Chronicle Ez	cocura.o2zCura PastoralisÚcocuraCzCura Pastoralis (Cotton)zcodicts.o34zDicts of Catoz
codocu1.o1zDocuments 1 (O1)zcodocu2.o12zDocuments 2 (O1/O2)z
codocu2.o2zDocuments 2 (O2)zcodocu3.o23zDocuments 3 (O2/O3)z
codocu3.o3zDocuments 3 (O3)zcodocu4.o24zDocuments 4 (O2/O4)Úcoeluc1z Honorius of Autun, Elucidarium 1Úcoeluc2zcoepigen.o3u   Ã†lfric's Epilogue to GenesisÚcoeuphrzSaint EuphrosyneÚcoeustz Saint Eustace and his companionsÚ	coexodusPz
Exodus (P)Ú	cogenesiCzGenesis (C)zcogregdC.o24zGregory's Dialogues (C)zcogregdH.o23zGregory's Dialogues (H)ÚcoherbarzPseudo-Apuleius, HerbariumzcoinspolD.o34z"Wulfstan's Institute of Polity (D)Ú	coinspolXz"Wulfstan's Institute of Polity (X)ÚcojameszSaint Jameszcolacnu.o23ÚLacnungaz
colaece.o2Ú	Leechdomszcolaw1cn.o3zLaws, Cnut Izcolaw2cn.o3zLaws, Cnut IIzcolaw5atr.o3u   Laws, Ã†thelred Vzcolaw6atr.o3u   Laws, Ã†thelred VIz
colawaf.o2zLaws, Alfredzcolawafint.o2zAlfred's Introduction to Lawszcolawger.o34zLaws, Gerefazcolawine.ox2z	Laws, Inezcolawnorthu.o3zNorthumbra Preosta Laguzcolawwllad.o4zLaws, William I, Ladzcoleofri.o4ÚLeofriczcolsigef.o3u   Ã†lfric's Letter to SigefyrthÚ	colsigewBu!   Ã†lfric's Letter to Sigeweard (B)zcolsigewZ.o34u!   Ã†lfric's Letter to Sigeweard (Z)Úcolwgeatu   Ã†lfric's Letter to WulfgeatÚ	colwsigeTu    Ã†lfric's Letter to Wulfsige (T)zcolwsigeXa.o34u!   Ã†lfric's Letter to Wulfsige (Xa)zcolwstan1.o3u   Ã†lfric's Letter to Wulfstan Izcolwstan2.o3u   Ã†lfric's Letter to Wulfstan IIzcomargaC.o34zSaint Margaret (C)ÚcomargaTzSaint Margaret (T)Úcomart1zMartyrology, IÚcomart2zMartyrology, IIzcomart3.o23zMartyrology, IIIzcomarvel.o23zMarvels of the EastÚcomaryzMary of EgyptÚconeotz
Saint NeotÚconicodAzGospel of Nicodemus (A)ÚconicodCzGospel of Nicodemus (C)ÚconicodDzGospel of Nicodemus (D)ÚconicodEzGospel of Nicodemus (E)zcoorosiu.o2ÚOrosiusz
cootest.o3Ú
Heptateuchzcoprefcath1.o3u(   Ã†lfric's Preface to Catholic Homilies Izcoprefcath2.o3u)   Ã†lfric's Preface to Catholic Homilies IIzcoprefcura.o2zPreface to the Cura Pastoraliszcoprefgen.o3u   Ã†lfric's Preface to Genesiszcopreflives.o3u$   Ã†lfric's Preface to Lives of Saintsz"Preface to Augustine's Soliloquiesz*Pseudo-Apuleius, Medicina de quadrupedibuszHistory of the Holy Rood-TreezSeven SleeperszSt. Augustine's SoliloquieszSolomon and Saturn IzSolomon and Saturn IIu   Ã†lfric's De Temporibus AnnizVercelli HomilieszVercelli Homilies (E)zVercelli Homilies (L)zSaint Vincent (Bodley 343)zVindicta SalvatoriszWest-Saxon GospelszWulfstan's Homilies)Úcoprefsolilozcoquadru.o23ÚcoroodÚ	cosevenslÚcosolilozcosolsat1.o4Ú	cosolsat2z
cotempo.o3ÚcoverhomÚ	coverhomEÚ	coverhomLÚcovinceBÚcovinsalzcowsgosp.o3z
cowulf.o34)rW   Úosr[   Únltk.corpus.reader.apiÚ nltk.corpus.reader.bracket_parser   Únltk.corpus.reader.taggedr   Únltk.corpus.reader.utilÚnltk.tokenizer   r"   r   r$   r(   r/   r   r   r   ú<module>rœ      s}  ðð
ð 
ð 
€	€	€	Ø 	€	€	€	à $Ð $Ð $Ð $Ø EÐ EÐ EÐ EÐ EÐ EØ 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø %Ð %Ð %Ð %Ø )Ð )Ð )Ð )Ð )Ð )ðeQð eQð eQð eQð eQ�|ñ eQô eQð eQðP8ð 8ð 8ð 8ð 8Ð4ñ 8ô 8ð 8ð
ð 
ð 
ð 
ð 
Ð/ñ 
ô 
ð 
ðeØÐ(ðeàÐ3ðeð Ð.ðeð Ð0ð	eð
 Ð3ðeð Ð'ðeð �ðeð Ð7ðeð Ð%ðeð Ð'ðeð Ð7ðeð Ð(ðeð Ð&ðeð Ð&ðeð Ð3ðeð  Ð4ð!eð" �,ð#eð eð$ Ð*ð%eð& Ð&ð'eð( Ð-ð)eð* Ð)ð+eð, Ð)ð-eð. Ð-ð/eð0 Ð"ð1eð2 Ð)ð3eð4 �?ð5eð6 Ð$ð7eð8 Ð(ð9eð: Ð$ð;eð< Ð(ð=eð> Ð$ð?eð@ Ð(ðAeðB Ð1ðCeðD Ð1ðEeð eð eðF Ð2ðGeðH Ð!ðIeðJ Ð0ðKeðL �ðMeðN �ðOeðP Ð-ðQeðR Ð-ðSeðT Ð,ðUeðV Ð9ðWeðX Ð5ðYeðZ ˆ}ð[eð\ �:ð]eð^ �+ð_eð` �>ðaeðb �?ðceðd Ð'ðeeðf Ð(ðgeð eð eðh �.ðieðj Ð4ðkeðl �Nðmeðn �Kðoeðp Ð/ðqeðr Ð+ðseðt �9ðueðv Ð2ðweðx Ð4ðyeðz Ð8ð{eð| Ð.ð}eð~ Ð3ðeð@ Ð9ðAeðB Ð4ðCeðD Ð5ðEeðF Ð(ðGeðH Ð$ðIeð eð eðJ ÐðKeðL Ð ðMeðN Ð%ðOeðP Ð)ðQeðR ˆoðSeðT ˆlðUeðV Ð)ðWeðX Ð)ðYeðZ Ð)ð[eð\ Ð)ð]eð^ �9ð_eð` �,ðaeðb Ð@ðceðd ÐAðeeðf Ð5ðgeðh Ð2ðieðj Ð<ðkeð eðl 9Ø@Ø-Ø!Ø-Ø*Ø(Ø0Ø#Ø(Ø(Ø,Ø%Ø'Ø'ðIeð eð e€	€	€	r   