+
    ÖÇÜh†,  ã                   ó€   € R t Rt^ RI5 ^ RIHtHt ^ RIHt  ! R R]4      tRR lt	 ! R	 R
]
4      t ! R R]4      tR# )z&
Corpus reader for the SemCor Corpus.
z
epytext en)Ú*)ÚXMLCorpusReaderÚXMLCorpusView)ÚTreec                   óŽ   a € ] tR t^t o RtRR ltRR ltRR ltRR3R ltRR lt	RR	 lt
RR3R
 ltR tR t]R 4       tRtT tR# )ÚSemcorCorpusReaderzñ
Corpus reader for the SemCor Corpus.
For access to the complete XML data structure, use the ``xml()``
method.  For access to simple word lists and tagged word lists, use
``words()``, ``sents()``, ``tagged_words()``, and ``tagged_sents()``.
c                óL   € \         P                  ! WV4       W@n        W0n        R # ©N)r   Ú__init__Ú_lazyÚ_wordnet)ÚselfÚrootÚfileidsÚwordnetÚlazys   &&&&&Ú;/usr/lib/python3/dist-packages/nltk/corpus/reader/semcor.pyr
   ÚSemcorCorpusReader.__init__   s   € Ü× Ò  ¨WÔ5ØŒ
ØŽó    Nc                ó,   € V P                  VRRRR4      # )zZ
:return: the given file(s) as a list of words and punctuation symbols.
:rtype: list(str)
ÚwordF©Ú_items©r   r   s   &&r   ÚwordsÚSemcorCorpusReader.words    s   € ð
 �{‰{˜7 F¨E°5¸%Ó@Ð@r   c                ó,   € V P                  VRRRR4      # )zœ
:return: the given file(s) as a list of chunks,
    each of which is a list of words and punctuation symbols
    that form a unit.
:rtype: list(list(str))
ÚchunkFr   r   s   &&r   ÚchunksÚSemcorCorpusReader.chunks'   s   € ð �{‰{˜7 G¨U°E¸5ÓAÐAr   Úposc                ó8   € V P                  VRRVR8g  VR8g  4      # )a  
:return: the given file(s) as a list of tagged chunks, represented
    in tree form.
:rtype: list(Tree)

:param tag: `'pos'` (part of speech), `'sem'` (semantic), or `'both'`
    to indicate the kind of tags to include.  Semantic tags consist of
    WordNet lemma IDs, plus an `'NE'` node if the chunk is a named entity
    without a specific entry in WordNet.  (Named entities of type 'other'
    have no lemma.  Other chunks not in WordNet have no semantic tag.
    Punctuation tokens have `None` for their part of speech tag.)
r   FÚsemr    r   ©r   r   Útags   &&&r   Útagged_chunksÚ SemcorCorpusReader.tagged_chunks0   s#   € ð �{‰{˜7 G¨U°C¸5±LÀ#ÈÁ,ÓOÐOr   c                ó,   € V P                  VRRRR4      # )zx
:return: the given file(s) as a list of sentences, each encoded
    as a list of word strings.
:rtype: list(list(str))
r   TFr   r   s   &&r   ÚsentsÚSemcorCorpusReader.sents?   s   € ð �{‰{˜7 F¨D°%¸Ó?Ð?r   c                ó,   € V P                  VRRRR4      # )zx
:return: the given file(s) as a list of sentences, each encoded
    as a list of chunks.
:rtype: list(list(list(str)))
r   TFr   r   s   &&r   Úchunk_sentsÚSemcorCorpusReader.chunk_sentsG   s   € ð �{‰{˜7 G¨T°5¸%Ó@Ð@r   c                ó8   € V P                  VRRVR8g  VR8g  4      # )aC  
:return: the given file(s) as a list of sentences. Each sentence
    is represented as a list of tagged chunks (in tree form).
:rtype: list(list(Tree))

:param tag: `'pos'` (part of speech), `'sem'` (semantic), or `'both'`
    to indicate the kind of tags to include.  Semantic tags consist of
    WordNet lemma IDs, plus an `'NE'` node if the chunk is a named entity
    without a specific entry in WordNet.  (Named entities of type 'other'
    have no lemma.  Other chunks not in WordNet have no semantic tag.
    Punctuation tokens have `None` for their part of speech tag.)
r   Tr"   r    r   r#   s   &&&r   Útagged_sentsÚSemcorCorpusReader.tagged_sentsO   s#   € ð �{‰{˜7 G¨T°3¸%±<ÀÈÁÓNÐNr   c                óü   a € VR 8X  d   V'       g   V 3R lpM$S P                   '       d   \        MS P                  p\        S P	                  V4       Uu. uF  pV! WrW4VS P
                  4      NK  	  up4      # u upi )r   c                  óf   <€ \        SP                  '       d   \        MSP                  ! V !  4      # r	   )ÚLazyConcatenationr   ÚSemcorWordViewÚ_words)Úargsr   s   *€r   Ú<lambda>Ú+SemcorCorpusReader._items.<locals>.<lambda>b   s$   ø€ Ô/Ø#'§:§: :•°4·;±;Ð>ÀÑFôr   )r   r3   r4   ÚconcatÚabspathsr   )r   r   ÚunitÚbracket_sentÚpos_tagÚsem_tagÚ_Úfileids   f&&&&&  r   r   ÚSemcorCorpusReader._items^   so   ø€ Ø�6Œ>§,ô‰Að #'§*§* *•°$·+±+ˆAÜð #Ÿm™m¨GÔ4óá4�Fñ �& °wÀÇÁÖNÙ4ñó
ð 	
ùòs   ÁA9c           	     óò  € VR9   g   Q h. p\         P                  V4      P                  4       pVP                  R4       Fª  p. p	\	        V4       FO  p
\
        P                  W¢WEV P                  4      pVR8X  d   V	P                  V4       K>  V	P                  V4       KQ  	  V'       d/   VP                  \        VP                  R,          V	4      4       K™  VP                  V	4       K¬  	  RV9  g   Q hV# )a  
Helper used to implement the view methods -- returns a list of
tokens, (segmented) words, chunks, or sentences. The tokens
and chunks may optionally be tagged (with POS and sense
information).

:param fileid: The name of the underlying file.
:param unit: One of `'token'`, `'word'`, or `'chunk'`.
:param bracket_sent: If true, include sentence bracketing.
:param pos_tag: Whether to include part-of-speech tags.
:param sem_tag: Whether to include semantic tags, namely WordNet lemma
    and OOV named entity status.
r   z.//sÚsnumN)Útokenr   r   )ÚElementTreeÚparseÚgetrootÚfindallÚ_all_xmlwords_inr   Ú_wordr   ÚextendÚappendÚSemcorSentenceÚattrib)r   r?   r:   r;   r<   r=   ÚresultÚxmldocÚxmlsentÚsentÚxmlwordÚitms   &&&&&&      r   r4   ÚSemcorCorpusReader._wordsn   sÖ   € ð Ð1Ô1Ð1Ð1Øˆä×"Ñ" 6Ó*×2Ñ2Ó4ˆØ—~‘~ fÖ-ˆGØˆDÜ+¨GÖ4�Ü(×.Ñ.Ø 7°T·]±]ó�ð ˜6”>Ø—K‘K Ö$à—K‘K Ö$ñ 5÷ Ø—‘œn¨W¯^©^¸FÕ-CÀTÓJÖKà—‘˜dÖ#ñ .ð  ˜6Ô!Ð!Ð!Øˆr   c                ó  € V P                   pV'       g   R pV P                  RV4      pV P                  R4      pVeA   VR,           V,           pR\        VP                  R4      ^ ,          4      ^,
          ,          p	MR;r‰V P                  RV4      p
V P                  R4      pRV P	                  4       9   pV P                  R	4      pVR
8X  d?   V'       g   V'       g   TpV# V3V'       d   V3MR,           V'       d   WiW¼3MR,           pV# VP                  R4      pVR8X  d   V# Ve    VP                  V4      pV'       d   \        Wß4      .MTpV'       d0   V'       d(   Ve   \        X\        RV4      .4      # \        RV4      # V'       d   Ve   \        XV4      # V'       d
   V^ ,          # V#   \         dJ     RTT	\        T4      3,          p L›  \         d#    TR,           T	,           R,           T,           p  LÇi ; ii ; i)Ú ÚlemmaÚlexsnNÚ%Ú:ÚrdfÚwnsnÚpnr    rC   r>   r   z
%s.%s.%02dÚ.ÚNE)ÚnÚvÚaÚrÚs© )	ÚtextÚgetÚintÚsplitÚkeysÚlemma_from_keyÚ	ExceptionÚ
ValueErrorr   )rR   r:   r<   r=   r   ÚtknrW   rX   Ú	sense_keyÚwnposÚredefÚsensenumÚisOOVEntityr    rS   ÚwwÚsenseÚbottoms   &&&&&             r   rI   ÚSemcorCorpusReader._word“   sþ  € à�l‰lˆßØˆCà—‘˜G SÓ)ˆØ—‘˜GÓ$ˆØÒØ � eÕ+ˆIØ-Ü�E—K‘K Ó$ QÕ'Ó(¨1Õ,õ‰Eð !%Ð$ˆIØ—‘Ø�3ó
ˆð —;‘;˜vÓ&ˆØ˜gŸl™l›nÑ,ˆØ�k‰kØó
ˆð �7Œ?ß§7Ø�ð ˆJð	 �Fß!(˜‘v¨bõ2ç@G˜ hÑ<ÈRõQð ð
 ˆJà—‘˜3“ˆBØ�vŒ~Ø�	àÒ'ðØ '× 6Ñ 6°yÓ A˜÷$ -4œ$˜s›-™¸�çŸ{ØÒ+Ü# E¬D°°vÓ,>Ð+?Ó@Ð@ä# D¨&Ó1Ð1ß Ò!5Ü  vÓ.Ð.ßØ! !�9Ð$à!�Møô; %ô ð	Ø$0Ø %Ø %Ü # H£ð4õ %šEøô
  *ô à %¨¥¨eÕ 3°cÕ 9¸HÕ Dó "ðúðús*   Ä,F5 Æ5H	ÇGÇ)HÈH	ÈHÈH	)r   r   )Tr	   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r
   r   r   r%   r(   r+   r.   r   r4   ÚstaticmethodrI   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r      sb   ø‡ € ñô ô
AôBð %)¨uô Pô@ôAð $(¨eô Oò
ò #ðJ ñJ"ó öJ"r   r   Nc                 ó‚   € Vf   . pV  F2  pVP                   R9   d   VP                  V4       K'  \        W!4       K4  	  V# )N©ÚwfÚpunc)r$   rK   rH   )ÚeltrN   Úchilds   && r   rH   rH   á   s=   € Ø‚~ØˆÛˆØ�9‰9˜Ô&Ø�M‰M˜%Ö ä˜UÖ+ñ	 ð
 €Mr   c                   ó*   a € ] tR t^ìt o RtR tRtV tR# )rL   z
A list of words, augmented by an attribute ``num`` used to record
the sentence identifier (the ``n`` attribute from the XML).
c                ó<   € Wn         \        P                  W4       R # r	   )ÚnumÚlistr
   )r   rŠ   Úitemss   &&&r   r
   ÚSemcorSentence.__init__ò   s   € ØŒÜ�‰�dÖ"r   )rŠ   N)rx   ry   rz   r{   r|   r
   r~   r   r€   s   @r   rL   rL   ì   s   ø‡ € ñ÷
#ð #r   rL   c                   ó<   a € ] tR t^÷t o RtR tR tR tR tRt	V t
R# )r3   zF
A stream backed corpus view specialized for use with the BNC corpus.
c                óŠ   € V'       d   RpMRpW n         W0n        W@n        WPn        W`n        \
        P                  ! WV4       R# )aC  
:param fileid: The name of the underlying file.
:param unit: One of `'token'`, `'word'`, or `'chunk'`.
:param bracket_sent: If true, include sentence bracketing.
:param pos_tag: Whether to include part-of-speech tags.
:param sem_tag: Whether to include semantic tags, namely WordNet lemma
    and OOV named entity status.
z.*/sz.*/s/(punc|wf)N)Ú_unitÚ_sentÚ_pos_tagÚ_sem_tagr   r   r
   )r   r?   r:   r;   r<   r=   r   Útagspecs   &&&&&&& r   r
   ÚSemcorWordView.__init__ü   s:   € ÷ Ø‰Gà&ˆGàŒ
Ø!Œ
ØŒØŒØŒä×Ò˜t¨WÖ5r   c                ój   € V P                   '       d   V P                  V4      # V P                  V4      # r	   )r‘   Úhandle_sentÚhandle_word)r   r†   Úcontexts   &&&r   Ú
handle_eltÚSemcorWordView.handle_elt  s-   € Ø�:�:ˆ:Ø×#Ñ# CÓ(Ð(à×#Ñ# CÓ(Ð(r   c                ó‚   € \         P                  WP                  V P                  V P                  V P
                  4      # r	   )r   rI   r�   r’   r“   r   )r   r†   s   &&r   r˜   ÚSemcorWordView.handle_word  s.   € Ü!×'Ñ'Ø—‘˜TŸ]™]¨D¯M©M¸4¿=¹=ó
ð 	
r   c                ó8  € . pV Fv  pVP                   R9   dI   V P                  V4      pV P                  R8X  d   VP                  V4       KI  VP	                  V4       K\  \        RVP                   ,          4      h	  \        VP                  R,          V4      # )r„   r   zUnexpected element %srB   rƒ   )r$   r˜   r�   rJ   rK   rm   rL   rM   )r   r†   rQ   r‡   rS   s   &&   r   r—   ÚSemcorWordView.handle_sent  s~   € ØˆÛˆEØ�y‰y˜NÔ*Ø×&Ñ& uÓ-�Ø—:‘: Ô'Ø—K‘K Ö$à—K‘K Ö$ä Ð!8¸5¿9¹9Õ!DÓEÐEñ ô ˜cŸj™j¨Õ0°$Ó7Ð7r   )r’   r“   r‘   r�   r   N)rx   ry   rz   r{   r|   r
   rš   r˜   r—   r~   r   r€   s   @r   r3   r3   ÷   s#   ø‡ € ñò6ò,)ò
÷
8ð 8r   r3   r	   )r|   Ú__docformat__Únltk.corpus.reader.apiÚnltk.corpus.reader.xmldocsr   r   Ú	nltk.treer   r   rH   r‹   rL   r3   re   r   r   Ú<module>r¤      sF   ðñð €ä $ß EÝ ôK"˜ô K"ô\ô#�Tô #ô18�]ö 18r   