
    /hP                     :    S SK r S SKrS SKrSr " S S5      rS rg)    NFc                   6    \ rS rSrSrS rS rS rS rS r	Sr
g	)
LazyCorpusLoader   ac  
To see the API documentation for this lazily loaded corpus, first
run corpus.ensure_loaded(), and then run help(this_corpus).

LazyCorpusLoader is a proxy object which is used to stand in for a
corpus object before the corpus is loaded.  This allows NLTK to
create an object for each corpus, but defer the costs associated
with loading those corpora until the first time that they're
actually accessed.

The first time this object is accessed in any way, it will load
the corresponding corpus, and transform itself into that corpus
(by modifying its own ``__class__`` and ``__dict__`` attributes).

If the corpus can not be found, then accessing this object will
raise an exception, displaying installation instructions for the
NLTK data package.  Once they've properly installed the data
package (or modified ``nltk.data.path`` to point to its location),
they can then use the corpus object without restarting python.

:param name: The name of the corpus
:type name: str
:param reader_cls: The specific CorpusReader class, e.g. PlaintextCorpusReader, WordListCorpusReader
:type reader: nltk.corpus.reader.api.CorpusReader
:param nltk_data_subdir: The subdirectory where the corpus is stored.
:type nltk_data_subdir: str
:param `*args`: Any other non-keywords arguments that `reader_cls` might need.
:param `**kwargs`: Any other keywords arguments that `reader_cls` might need.
c                     SSK Jn  [        X%5      (       d   eU=U l        U l        X l        SU;   a  US   U l        UR                  SS 5        OSU l        X0l        X@l	        g )Nr   )CorpusReadernltk_data_subdircorpora)
nltk.corpus.reader.apir   
issubclass_LazyCorpusLoader__name__name___LazyCorpusLoader__reader_clssubdirpop_LazyCorpusLoader__args_LazyCorpusLoader__kwargs)selfname
reader_clsargskwargsr   s         H/var/www/auris/envauris/lib/python3.13/site-packages/nltk/corpus/util.py__init__LazyCorpusLoader.__init__3   s_    7*3333&**dm&' !34DKJJ)40#DK    c                   ^^^^	 [         R                  " SSU R                  5      n[        (       a0   [        R
                  R                  U R                   SU 35      nO9 [        R
                  R                  U R                   SU R                   35      nU R                  " U/U R                  Q70 U R                  D6nU R                  U R                  smmU R                  U R                  smm	UR                  U l        UR                  U l        UUUU	4S jn[        XP5      U l        g ! [         aS  n [        R
                  R                  U R                   SU R                   35      n S nAN! [         a    Uef = fS nAff = f! [         aJ  n [        R
                  R                  U R                   SU 35      n S nAGN7! [         a    Uef = fS nAff = f)Nz(([^/]+)(/.*)?)z
\2.zip/\1//c                    > [        TT/TQ70 TD6nUR                  U l        UR                  U l        [        R                  " 5         g N)r   __dict__	__class__gccollect)r   lazy_readerr   r   r   r   s     r   _unload(LazyCorpusLoader.__load.<locals>._unloadh   s<    *4MdMfMK'00DM(22DNJJLr   )resubr   TRY_ZIPFILE_FIRSTnltkdatafindr   LookupErrorr   r   r   r    r!   _make_bound_methodr%   )
r   zip_namerootecorpusr%   r   r   r   r   s
         @@@@r   __loadLazyCorpusLoader.__loadD   s   66,mT[[Iyy~~Qxj&AByy~~Qt{{m&DE ""4G$++GG {{DMMf;;(9(9j))
	 	 *'8I  99>>T[[M4;;-*HID" G  99>>T[[M8**EFD" GsG   .D3 #8F 3
F>8E;;FFF
G'.GGG""G'c                 Z    US:X  a  [        S5      eU R                  5         [        X5      $ )N	__bases__z4LazyCorpusLoader object has no attribute '__bases__')AttributeError_LazyCorpusLoader__loadgetattr)r   attrs     r   __getattr__LazyCorpusLoader.__getattr__p   s.    
 ; !WXX t""r   c                 h    SR                  U R                  R                  SU R                  -   5      $ )Nz<{} in {!r} (not loaded yet)>z.../corpora/)formatr   r   r   r   s    r   __repr__LazyCorpusLoader.__repr__}   s0    .55&&T[[(
 	
r   c                     g r    r?   s    r   r%   LazyCorpusLoader._unload   s     	r   )	__argsr!   r    __kwargs__namer   __reader_clsr%   r   N)r   
__module____qualname____firstlineno____doc__r   r8   r;   r@   r%   __static_attributes__rC   r   r   r   r      s!    <"*9X#
r   r   c                      " S S5      nU" 5       n[        UR                  5      n U" XUR                  5      $ ! [         a    U" X5      s $ f = f)z6
Magic for creating bound methods (used for _unload).
c                       \ rS rSrS rSrg)_make_bound_method.<locals>.Foo   c                     g r   rC   r?   s    r   meth$_make_bound_method.<locals>.Foo.meth   s    r   rC   N)r   rI   rJ   rK   rS   rM   rC   r   r   FoorP      s    	r   rU   )typerS   r!   	TypeError)funcr   rU   fbound_methods        r   r.   r.      sR    
  	A<L(D77 (D''(s   ; AA)r"   r'   r*   r)   r   r.   rC   r   r   <module>r[      s(    
 	  s sl(r   