ó
    ´OÂf—•  ã                   ó  • S SK r S SKrS SKrS SKrS SKrS SKrS SKrS SKrS SKrS SK	r	S SK
Jr  Sq/ qS$S jrS%S jr " S S\5      r\R$                  " S5      rS r\R$                  " S	5      rS
 r\R$                  " S5      rS rS rS rS rS r " S S5      r " S S5      r      S&S jr S'S jr  S'S jr!      S(S jr"      S(S jr#      S)S jr$      S)S jr%S r&S r'S r( " S S 5      r)S*S! jr*S" r+S# r,g)+é    N)ÚElementTreec                 óŒ   • [        SU SS/US/S9qUb1  [        U[        5      (       a  UR	                  5       n[        U5      qgg)a­  
Configure nltk's java interface, by letting nltk know where it can
find the Java binary, and what extra options (if any) should be
passed to Java when it is run.

:param bin: The full path to the Java binary.  If not specified,
    then nltk will search the system for a Java binary; and if
    one is not found, it will raise a ``LookupError`` exception.
:type bin: str
:param options: A list of options that should be passed to the
    Java binary when it is called.  A common value is
    ``'-Xmx512m'``, which tells Java binary to increase
    the maximum heap size to 512 megabytes.  If no options are
    specified, then do not modify the options list.
:type options: list(str)
ÚjavaÚJAVAHOMEÚ	JAVA_HOMEzjava.exe)Úenv_varsÚverboseÚbinary_namesN)Úfind_binaryÚ	_java_binÚ
isinstanceÚstrÚsplitÚlistÚ_java_options)ÚbinÚoptionsr	   s      Ú0/usr/lib/python3/dist-packages/nltk/internals.pyÚconfig_javar      sR   € ô$ ØØØ˜kÐ*ØØ �\ñ€Ið ÑÜ�gœs×#Ñ#Ø—m‘m“oˆGÜ˜W›‰ð ó    c                 óæ  • [         R                  [         R                  [         R                  S.nUR	                  X"5      nUR	                  X35      nUR	                  XD5      n[        U [        5      (       a  [        S5      e[        c
  [        5         [        U[        5      (       a  U/nO[        U5      n[        R                  R                  R                  U5      n[        U 5      n SU/U -   n [        /[        -   U -   n [         R                   " XX4S9nU(       d  U$ UR#                  5       u  p4UR$                  S:w  a+  ['        [)        U5      5        [+        S[        U 5      -   5      eX44$ )aÕ  
Execute the given java command, by opening a subprocess that calls
Java.  If java has not yet been configured, it will be configured
by calling ``config_java()`` with no arguments.

:param cmd: The java command that should be called, formatted as
    a list of strings.  Typically, the first string will be the name
    of the java class; and the remaining strings will be arguments
    for that java class.
:type cmd: list(str)

:param classpath: A ``':'`` separated list of directories, JAR
    archives, and ZIP archives to search for class files.
:type classpath: str

:param stdin: Specify the executed program's
    standard input file handles, respectively.  Valid values are ``subprocess.PIPE``,
    an existing file descriptor (a positive integer), an existing
    file object, 'pipe', 'stdout', 'devnull' and None.  ``subprocess.PIPE`` indicates that a
    new pipe to the child should be created.  With None, no
    redirection will occur; the child's file handles will be
    inherited from the parent.  Additionally, stderr can be
    ``subprocess.STDOUT``, which indicates that the stderr data
    from the applications should be captured into the same file
    handle as for stdout.

:param stdout: Specify the executed program's standard output file
    handle. See ``stdin`` for valid values.

:param stderr: Specify the executed program's standard error file
    handle. See ``stdin`` for valid values.


:param blocking: If ``false``, then return immediately after
    spawning the subprocess.  In this case, the return value is
    the ``Popen`` object, and not a ``(stdout, stderr)`` tuple.

:return: If ``blocking=True``, then return a tuple ``(stdout,
    stderr)``, containing the stdout and stderr outputs generated
    by the java command if the ``stdout`` and ``stderr`` parameters
    were set to ``subprocess.PIPE``; or None otherwise.  If
    ``blocking=False``, then return a ``subprocess.Popen`` object.

:raise OSError: If the java command returns a nonzero return code.
)ÚpipeÚstdoutÚdevnullzcmd should be a list of stringsz-cp)Ústdinr   Ústderrr   zJava command failed : )Ú
subprocessÚPIPEÚSTDOUTÚDEVNULLÚgetr   r   Ú	TypeErrorr   r   r   ÚosÚpathÚpathsepÚjoinr   ÚPopenÚcommunicateÚ
returncodeÚprintÚ_decode_stdoutdataÚOSError)	ÚcmdÚ	classpathr   r   r   ÚblockingÚsubprocess_output_dictÚ
classpathsÚps	            r   r   r   ?   sD  € ô` —‘Ü×#Ñ#Ü×%Ñ%ñÐð #×&Ñ& uÓ4€EØ#×'Ñ'¨Ó7€FØ#×'Ñ'¨Ó7€Fä�#”s×ÑÜÐ9Ó:Ð:ô ÑÜŒô �)œS×!Ñ!Ø�[‰
ä˜)“_ˆ
Ü—‘—‘×$Ñ$ ZÓ0€Iô ˆs‹)€CØ�)Ð
˜sÑ
"€CÜˆ+œÑ
%¨Ñ
+€Cô 	×Ò˜°&ÑH€AÞØˆØ—}‘}“Ñ€Vð 	‡|�|�qÓÜÔ  Ó(Ô)ÜÐ.´°S³Ñ9Ó:Ð:àÐÐr   c                   ó$   • \ rS rSrSrS rS rSrg)Ú	ReadErroréž   z¹
Exception raised by read_* functions when they fail.
:param position: The index in the input string where an error occurred.
:param expected: What was expected when an error occurred.
c                 óH   • [         R                  XU5        Xl        X l        g ©N)Ú
ValueErrorÚ__init__ÚexpectedÚposition)Úselfr:   r;   s      r   r9   ÚReadError.__init__¥   s   € Ü×Ñ˜D¨HÔ5Ø ŒØ �r   c                 ó:   • SU R                    SU R                   3$ )Nz	Expected z at ©r:   r;   ©r<   s    r   Ú__str__ÚReadError.__str__ª   s   € Ø˜4Ÿ=™=˜/¨¨d¯m©m¨_Ð=Ð=r   r?   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r9   rA   Ú__static_attributes__© r   r   r4   r4   ž   s   † ñò!õ
>r   r4   z[uU]?[rR]?(\"\"\"|\'\'\'|\"|\')c                 óþ  • [         R                  X5      nU(       d  [        SU5      eUR                  S5      n[        R
                  " SU-  5      nUR                  5       n UR                  X5      nU(       d  [        SU5      eUR                  S5      S:X  a  UR                  5       S-   nOOMP   [        XUR                  5        5      UR                  5       4$ ! [         a  n[        SU5      UeSnAff = f)	aM  
If a Python string literal begins at the specified position in the
given string, then return a tuple ``(val, end_position)``
containing the value of the string literal and the position where
it ends.  Otherwise, raise a ``ReadError``.

:param s: A string that will be checked to see if within which a
    Python string literal exists.
:type s: str

:param start_position: The specified beginning position of the string ``s``
    to begin regex matching.
:type start_position: int

:return: A tuple containing the matched string literal evaluated as a
    string and the end position of the string literal.
:rtype: tuple(str, int)

:raise ReadError: If the ``_STRING_START_RE`` regex doesn't return a
    match in ``s`` at ``start_position``, i.e., open quote. If the
    ``_STRING_END_RE`` regex doesn't return a match in ``s`` at the
    end of the first match, i.e., close quote.
:raise ValueError: If an invalid string (i.e., contains an invalid
    escape sequence) is passed into the ``eval``.

:Example:

>>> from nltk.internals import read_str
>>> read_str('"Hello", World!', 0)
('Hello', 7)

z
open quoteé   z\\|%szclose quoter   Ú\zvalid escape sequenceN)
Ú_STRING_START_REÚmatchr4   ÚgroupÚreÚcompileÚendÚsearchÚevalr8   )ÚsÚstart_positionÚmÚ	quotemarkÚ_STRING_END_REr;   rN   Úes           r   Úread_strr[   ±   så   € ôD 	×Ñ˜qÓ1€AÞÜ˜ nÓ5Ð5Ø—‘˜“
€Iô —Z’Z ¨9Ñ 4Ó5€NØ�u‰u‹w€HØ
Ø×%Ñ% aÓ2ˆÞÜ˜M¨8Ó4Ð4Ø�;‰;�q‹>˜TÓ!Ø—y‘y“{ Q‘‰Hàñ ðHÜ�A u§y¡y£{Ð3Ó4°e·i±i³kÐAÐAøÜó HÜÐ/°Ó@ÀaÐGûðHús   Â5*C  Ã 
C<Ã*C7Ã7C<z-?\d+c                 ó¤   • [         R                  X5      nU(       d  [        SU5      e[        UR	                  5       5      UR                  5       4$ )a  
If an integer begins at the specified position in the given
string, then return a tuple ``(val, end_position)`` containing the
value of the integer and the position where it ends.  Otherwise,
raise a ``ReadError``.

:param s: A string that will be checked to see if within which a
    Python integer exists.
:type s: str

:param start_position: The specified beginning position of the string ``s``
    to begin regex matching.
:type start_position: int

:return: A tuple containing the matched integer casted to an int,
    and the end position of the int in ``s``.
:rtype: tuple(int, int)

:raise ReadError: If the ``_READ_INT_RE`` regex doesn't return a
    match in ``s`` at ``start_position``.

:Example:

>>> from nltk.internals import read_int
>>> read_int('42 is the answer', 0)
(42, 2)

Úinteger)Ú_READ_INT_RErN   r4   ÚintrO   rR   ©rU   rV   rW   s      r   Úread_intra   ï   s?   € ô: 	×Ñ˜1Ó-€AÞÜ˜	 >Ó2Ð2Üˆq�w‰w‹y‹>˜1Ÿ5™5›7Ð"Ð"r   z-?(\d*)([.]?\d*)?c                 óz  • [         R                  X5      nU(       a,  UR                  S5      (       d"  UR                  S5      (       d  [        SU5      eUR                  S5      (       a)  [	        UR                  5       5      UR                  5       4$ [        UR                  5       5      UR                  5       4$ )a:  
If an integer or float begins at the specified position in the
given string, then return a tuple ``(val, end_position)``
containing the value of the number and the position where it ends.
Otherwise, raise a ``ReadError``.

:param s: A string that will be checked to see if within which a
    Python number exists.
:type s: str

:param start_position: The specified beginning position of the string ``s``
    to begin regex matching.
:type start_position: int

:return: A tuple containing the matched number casted to a ``float``,
    and the end position of the number in ``s``.
:rtype: tuple(float, int)

:raise ReadError: If the ``_READ_NUMBER_VALUE`` regex doesn't return a
    match in ``s`` at ``start_position``.

:Example:

>>> from nltk.internals import read_number
>>> read_number('Pi is 3.14159', 6)
(3.14159, 13)

rK   é   Únumber)Ú_READ_NUMBER_VALUErN   rO   r4   ÚfloatrR   r_   r`   s      r   Úread_numberrg     s€   € ô: 	× Ñ  Ó3€AÞ�Q—W‘W˜Q—Z‘Z 1§7¡7¨1§:¡:Ü˜ .Ó1Ð1Ø‡w�wˆq‡z�zÜ�Q—W‘W“YÓ §¡£Ð(Ð(ä�1—7‘7“9‹~˜qŸu™u›wÐ&Ð&r   c                 ó\  • [        U [        R                  5      (       a~  U R                  R                  bg  U R
                  n[        U R                  R                  5       Vs/ s H#  nXR                  ;   d  M  UR                  U   PM%     nn[        U5      S:„  $ [        S5      es  snf )a‹  
:return: True if ``method`` overrides some method with the same
    name in a base class.  This is typically used when defining
    abstract base classes or interfaces, to allow subclasses to define
    either of two related methods:

    >>> class EaterI:
    ...     '''Subclass must define eat() or batch_eat().'''
    ...     def eat(self, food):
    ...         if overridden(self.batch_eat):
    ...             return self.batch_eat([food])[0]
    ...         else:
    ...             raise NotImplementedError()
    ...     def batch_eat(self, foods):
    ...         return [self.eat(food) for food in foods]

:type method: instance method
rK   zExpected an instance method.)
r   ÚtypesÚ
MethodTypeÚ__self__Ú	__class__rC   Ú_mroÚ__dict__Úlenr"   )ÚmethodÚnameÚclsÚfuncss       r   Ú
overriddenrt   @  s–   € ô& �&œ%×*Ñ*×+Ñ+°·±×0IÑ0IÑ0UØ�‰ˆô ˜FŸO™O×5Ñ5Ô6ó
â6�Ø—|‘|Ñ#ó ˆC�L‰L˜ÔÙ6ð 	ð 
ô
 �5‹z˜A‰~ÐäÐ6Ó7Ð7ùò
s   Á$B)Á;B)c                 ó¨   • [        U [        5      (       a  U R                  $ U /nU R                   H  nUR	                  [        U5      5        M     U$ )aA  
Return the method resolution order for ``cls`` -- i.e., a list
containing ``cls`` and all its base classes, in the order in which
they would be checked by ``getattr``.  For new-style classes, this
is just cls.__mro__.  For classic classes, this can be obtained by
a depth-first left-to-right traversal of ``__bases__``.
)r   ÚtypeÚ__mro__Ú	__bases__Úextendrm   )rr   ÚmroÚbases      r   rm   rm   _  sE   € ô �#”t×ÑØ�{‰{ÐàˆeˆØ—M”MˆDØ�J‰J”t˜D“zÖ"ñ "àˆ
r   c                 ód  • SnU R                   (       ad  U R                   R                  5       S-   U l         [        R                  " SU R                   R	                  5       5      nU(       a  [        U5      nOSU l         U =R                   [        R                  " SU SU 3UUS-   S9-  sl         g)	z4Add an epytext @field to a given object's docstring.Ú ú

z(?<=\n)[ ]+(?!\s)Ú@ú: ú    ©Úinitial_indentÚsubsequent_indentN)rG   ÚrstriprP   ÚfindallÚ
expandtabsÚminÚtextwrapÚfill)ÚobjÚfieldÚmessageÚindentÚindentss        r   Ú_add_epytext_fieldr�   v  s�   € à€Fð ‡{‡{Ø—k‘k×(Ñ(Ó*¨VÑ3ˆŒÜ—*’*Ð1°3·;±;×3IÑ3IÓ3KÓLˆÞÜ˜“\ˆFøð ˆŒà‡K‚K”8—=’=Ø
ˆEˆ7�"�W�IÐØØ  6™/ññ †Kr   c                 ó   ^ • U 4S jnU$ )a  
A decorator used to mark functions as deprecated.  This will cause
a warning to be printed the when the function is used.  Usage:

    >>> from nltk.internals import deprecated
    >>> @deprecated('Use foo() instead')
    ... def bar(x):
    ...     print(x/10)

c                 ó&  >^ ^• ST R                    ST 3mS[        R                  " TSSS9-   mU U4S jnUR                  R	                  T R                  5        T R                   Ul         T R
                  Ul        SUl        [        UST5        U$ )	Nz	Function z() has been deprecated.  Ú
ú  r‚   c                  óH   >• [         R                  " T[        SS9  T" U 0 UD6$ )Nrc   ©ÚcategoryÚ
stacklevel)ÚwarningsÚwarnÚDeprecationWarning)ÚargsÚkwargsÚfuncÚmsgs     €€r   ÚnewFuncÚ.deprecated.<locals>.decorator.<locals>.newFunc›  s$   ø€ Ü�MŠM˜#Ô(:ÀqÒIÙ˜Ð( Ñ(Ð(r   TÚ
deprecated)rC   r‰   rŠ   rn   ÚupdaterG   Ú__deprecated__r�   )rž   r    rŸ   r�   s   ` @€r   Ú	decoratorÚdeprecated.<locals>.decorator—  s€   ú€ Ø˜$Ÿ-™-˜Ð(AÀ'ÀÐKˆØ”X—]’] 3°tÈtÑTÑTˆö	)ð
 	×Ñ×Ñ §¡Ô.ØŸ=™=ˆÔØŸ,™,ˆŒØ!%ˆÔä˜7 L°'Ô:Øˆr   rI   )r�   r¥   s   ` r   r¢   r¢   ‹  s   ø€ õð" Ðr   c                   ó   • \ rS rSrSrS rSrg)Ú
Deprecatedi«  a©  
A base class used to mark deprecated classes.  A typical usage is to
alert users that the name of a class has changed:

    >>> from nltk.internals import Deprecated
    >>> class NewClassName:
    ...     pass # All logic goes here.
    ...
    >>> class OldClassName(Deprecated, NewClassName):
    ...     "Use NewClassName instead."

The docstring of the deprecated class will be used in the
deprecation warning message.
c                 ó  • S n[        U 5       H  n[        UR                  ;   d  M  Un  O   U(       d   S5       eUR                  =(       d    SR	                  5       n[
        R                  " SSU5      n[
        R                  " SSU5      nSUR                  -  nX:w  a  USU R                  -  -  nU SU 3nS[        R                  " US	S	S
9-   n[        R                  " U[        SS9  [        R                  U 5      $ )Nz-Unable to determine which base is deprecated.r}   z\A\s*@deprecated:z(?m)^\s*zClass %sz (base class for %s)z has been deprecated.  r“   r�   r‚   rc   r–   )rm   r¨   rx   rG   ÚstriprP   ÚsubrC   r‰   rŠ   r™   rš   r›   ÚobjectÚ__new__)rr   rœ   r�   Údep_clsr{   Údocrq   rŸ   s           r   r­   ÚDeprecated.__new__»  sæ   € àˆÜ˜–IˆDÜ˜TŸ^™^Õ+Ø�Ùñ ö ÐGÐGÓGˆwð �o‰o×+ §¡£ˆä�fŠfÐ)¨3°Ó4ˆä�fŠf�[ " cÓ*ˆà˜G×,Ñ,Ñ,ˆØ‹>ØÐ*¨S¯\©\Ñ9Ñ9ˆDà�Ð-¨c¨UÐ3ˆà”X—]’] 3°vÐQWÑXÑXˆÜ�Š�cÔ$6À1ÒEä�~‰~˜cÓ"Ð"r   rI   N)rC   rD   rE   rF   rG   r­   rH   rI   r   r   r¨   r¨   «  s   † ñõ#r   r¨   c                   ó(   • \ rS rSrSrSS jrS rSrg)ÚCounteriÜ  z=
A counter that auto-increments each time its value is read.
c                 ó   • Xl         g r7   ©Ú_value)r<   Úinitial_values     r   r9   ÚCounter.__init__á  s   € Ø#�r   c                 óD   • U =R                   S-  sl         U R                   $ ©NrK   r´   r@   s    r   r!   ÚCounter.getä  s   € Ø�Š�qÑ�Ø�{‰{Ðr   r´   N)r   )rC   rD   rE   rF   rG   r9   r!   rH   rI   r   r   r²   r²   Ü  s   † ñô$õr   r²   c           
   #   óÐ	  #   • U /U=(       d    / -   n[        U [        5      (       d   e[        U[        5      (       a   e[        U[        5      (       a   e[        U[        5      (       a  UR                  5       nSnU GH  n[        R                  R                  X5      n	[        R                  R                  U	5      (       a  U(       a  [        SU  SU	 S35        SnU	v •  [        R                  R                  U5      (       a  U(       a  [        SU  SU S35        SnUv •  [        R                  R                  U SU5      n	[        R                  R                  U	5      (       d  Mð  U(       a  [        SU  SU	 S35        SnU	v •  GM     U GH…  n
U
[        R                  ;   d  M  U(       a  Sn[        R                  U
   v •  [        R                  U
   R                  [        R                  5       GH  n[        R                  R                  U5      (       a  U(       a  [        SU  SU S35        SnUv •  U HË  n[        R                  R                  X¸5      n	[        R                  R                  U	5      (       a  U(       a  [        SU  SU	 S35        SnU	v •  [        R                  R                  USU5      n	[        R                  R                  U	5      (       d  M¬  U(       a  [        SU  SU	 S35        SnU	v •  MÍ     GM     GMˆ     U HW  nU HN  n[        R                  R                  XÈ5      n	[        R                  R                  U	5      (       d  MH  SnU	v •  MP     MY     [        R                  S:X  aÂ  U H¼  n [        R                  " S	U/[        R                  [        R                  S
9nUR                  5       u  pï[        U5      R!                  5       nUR#                  U5      (       aC  [        R                  R%                  U5      (       a  U(       a  [        SU  SU S35        SnUv •  M¾     U(       dl  SU -  nU(       a  USUS   -  -  nUS-  nU(       a   US-  nUSR                  S U 5       5      -  nU(       a  USU  SU S3-  nSn[-        SU SU SU 35      eg! [&        [(        [*        4 a    e f = f! f = f7f)a  
Search for a file to be used by nltk.

:param filename: The name or path of the file.
:param env_vars: A list of environment variable names to check.
:param file_names: A list of alternative file names to check.
:param searchpath: List of directories to search.
:param url: URL presented to user for download help.
:param verbose: Whether or not to print path when a file is found.
Fú[Found r€   Ú]TÚfiler   ÚposixÚwhich)r   r   zSNLTK was unable to find the %s file!
Use software specific configuration parametersz# or set the %s environment variabler   Ú.ú

  Searched in:r}   c              3   ó,   #   • U  H
  nS U-  v •  M     g7f©z	
    - %sNrI   ©Ú.0Úds     r   Ú	<genexpr>Ú!find_file_iter.<locals>.<genexpr>j  ó   é € Ð@²Z°˜<¨!Ö+²Zùó   ‚z

  For more information on z, see:
    <Ú>úK===========================================================================r~   r“   N)r   r   r   r#   r$   r&   Úisfiler*   Úenvironr%   rq   r   r'   r   r(   r+   rª   ÚendswithÚexistsÚKeyboardInterruptÚ
SystemExitr,   ÚLookupError)Úfilenamer   Ú
searchpathÚ
file_namesÚurlr	   Úfinding_dirÚyieldedÚalternativeÚpath_to_fileÚenv_varÚenv_dirÚ	directoryr2   r   r   r$   rŸ   Údivs                      r   Úfind_file_iterrá   î  s3  é € ð& �˜z×/¨RÑ0€JÜ�h¤×$Ñ$Ð$Ð$Ü˜*¤c×*Ñ*Ð*Ð*Ü˜*¤c×*Ñ*Ð*Ð*Ü�(œC× Ñ Ø—>‘>Ó#ˆØ€Gô "ˆÜ—w‘w—|‘| HÓ:ˆÜ�7‰7�>‰>˜,×'Ñ'ÞÜ˜ ˜z¨¨L¨>¸Ð;Ô<ØˆGØÒä�7‰7�>‰>˜+×&Ñ&ÞÜ˜ ˜z¨¨K¨=¸Ð:Ô;ØˆGØÒä—w‘w—|‘| H¨f°kÓBˆÜ�7‰7�>‰>˜,×'Ó'ÞÜ˜ ˜z¨¨L¨>¸Ð;Ô<ØˆGØÕñ' "ô, ˆØ”b—j‘jÕ ÞØ�Ü—j‘j Ñ)Ò)äŸ:™: gÑ.×4Ñ4´R·Z±Z×@�ä—7‘7—>‘> '×*Ñ*ÞÜ ¨ z°°G°9¸AÐ>Ô?Ø"�GØ!’Mã#-�KÜ#%§7¡7§<¡<°Ó#E�LÜ—w‘w—~‘~ l×3Ñ3Þ"Ü! G¨H¨:°R¸°~ÀQÐ"GÔHØ"&˜Ø*Ò*ô
 $&§7¡7§<¡<°¸ÀÓ#L�Lä—w‘w—~‘~ l×3Ó3Þ"Ü! G¨H¨:°R¸°~ÀQÐ"GÔHØ"&˜Ø*Ô*ô# $.ô Añ óD  ˆ	Û%ˆKÜŸ7™7Ÿ<™<¨	Ó?ˆLÜ�w‰w�~‰~˜l×+Ó+Ø�Ø"Ô"ó	 &ñ  ô 
‡w�w�'ÓÛ%ˆKðÜ×$Ò$Ø˜kÐ*Ü%Ÿ?™?Ü%Ÿ?™?ñ�ð
 "#§¡£‘�Ü)¨&Ó1×7Ñ7Ó9�Ø—=‘= ×-Ñ-´"·'±'·.±.À×2FÑ2FÞÜ ¨ z°°D°6¸Ð;Ô<Ø"�GØ’Jñ ñ# &ö& ð'à)1ñ2ð 	ö
 ØÐ8¸8ÀA¹;ÑFÑFˆCØˆs‰
ˆÞØÐ'Ñ'ˆCØ�2—7‘7Ñ@±ZÓ@Ó@Ñ@ˆCÞØÐ3°H°:¸]È3È%ÈqÐQÑQˆCØˆÜ˜D   R¨ u¨B¨s¨eÐ4Ó5Ð5ð øô &¤z´7Ð;ó Øðûð üsF   ‚E*S&Å0<S&Æ0D?S&Ë3A8S&Í/'S&ÎB8SÑA8S&ÓSÓS!Ó!S#Ó#S&c           
      ó.   • [        [        XX#XE5      5      $ r7   ©Únextrá   ©rÕ   r   rÖ   r×   rØ   r	   s         r   Ú	find_fileræ   q  s   € ô Ü�x¨:À3ÓPóð r   c                 ó,   • [        [        XX#XESS95      $ )NT)rÙ   rã   rå   s         r   Úfind_dirrè   y  s#   € ô ÜØ 
¸ÐRVñ	
óð r   c              #   óN   #   • [        U=(       d    U X#XEU5       Sh  v•N   g N7f)a¾  
Search for a file to be used by nltk.

:param name: The name or path of the file.
:param path_to_bin: The user-supplied binary location (deprecated)
:param env_vars: A list of environment variable names to check.
:param file_names: A list of alternative file names to check.
:param searchpath: List of directories to search.
:param url: URL presented to user for download help.
:param verbose: Whether or not to print path when a file is found.
N)rá   ©rq   Úpath_to_binr   rÖ   r
   rØ   r	   s          r   Úfind_binary_iterrì   ƒ  s'   é € ô( Ø×�t˜X°<Àgó÷ ó ùs   ‚%�#ž%c                 ó0   • [        [        XX#XEU5      5      $ r7   )rä   rì   rê   s          r   r   r   œ  s"   € ô ÜØ˜x°\Èó	
óð r   c              #   óŒ  ^#   • [        U [        5      (       d   e[        U[        5      (       a   e[        U[        5      (       a  UR                  5       nSnS/[        U5      -   nUb<  [        R
                  R                  U5      (       a  SnUv •  O[        SU  SU 35      eU GHs  nU[        R                  ;   d  M  US:X  Ga<  [        R                  S   n	U	R                  [        R
                  R                  5       GHø  n
[        R
                  R                  U
5      n
[        R
                  R                  U
5      (       al  [        R
                  R                  U
5      nU(       a  [        R                  " X5      (       d  U(       d$  X°:X  a  U(       a  [        SU  SU
 S	35        SnU
v •  [        R
                  R                  U
5      (       d  MÙ  U(       dƒ  [        R
                  R                  [        R
                  R!                  X 5      5      (       a?  U(       a  [        SU  SU
 S	35        Sn[        R
                  R!                  X 5      v •  GM`  GMc  [        R"                  " U
5       H{  n[        R                  " X5      (       d  M   U(       a1  [        SU < S[        R
                  R!                  X¬5      < S	35        Sn[        R
                  R!                  X¬5      v •  M}     GMû     GM]  [        R
                  R                  [        R                  U   5      m[        R
                  R                  T5      (       a   U4S
 j[        R"                  " T5       5       OT4nU H™  n[        R
                  R                  U5      (       d  M)  [        R
                  R                  U5      nU(       a  [        R                  " X5      (       d  U(       a  Ms  X°:X  d  Mz  U(       a  [        SU  SU S	35        SnUv •  M›     GMv     U GH  nU(       aœ  [        R"                  " U5       H€  n[        R
                  R!                  Xë5      n[        R
                  R                  U5      (       a4  [        R                  " X5      (       a  U(       a  [        SU SU S	35        SnUv •  M‚     M§  [        R
                  R!                  Xà5      n[        R
                  R                  U5      (       d  Mì  U(       a  [        SU  SU S	35        SnUv •  GM     U(       d‰  SU -  nU(       a  USUS   -  -  n[$        R&                  " US-   SSS9nU(       a   US-  nUSR!                  S U 5       5      -  nU(       a  USR)                  U U5      -  nSn[        SU SU SU 35      eg7f)a¡  
Search for a jar that is used by nltk.

:param name_pattern: The name of the jar file
:param path_to_jar: The user-supplied jar location, or None.
:param env_vars: A list of environment variable names to check
                 in addition to the CLASSPATH variable which is
                 checked by default.
:param searchpath: List of directories to search.
:param is_regex: Whether name is a regular expression.
FÚ	CLASSPATHNTzCould not find z jar file at r¼   r€   r½   c              3   ód   >#   • U  H%  n[         R                  R                  TU5      v •  M'     g 7fr7   )r#   r$   r&   )rÆ   Úpath_to_jarÚjar_envs     €r   rÈ   Ú find_jar_iter.<locals>.<genexpr>  s*   øé € ð â+>˜Kô Ÿ™Ÿ™ W¨k×:Ð:Ú+>ùs   ƒ-0zNLTK was unable to find %s!z  Set the %s environment variabler   rÁ   r”   r‚   rÂ   r}   c              3   ó,   #   • U  H
  nS U-  v •  M     g7frÄ   rI   rÅ   s     r   rÈ   ró   0  rÊ   rË   z.

  For more information, on {}, see:
    <{}>rÍ   r~   r“   )r   r   r   r   r#   r$   rÎ   rÔ   rÏ   r%   Ú
expanduserÚbasenamerP   rN   r*   Úisdirr&   Úlistdirr‰   rŠ   Úformat)Úname_patternrñ   r   rÖ   rØ   r	   Úis_regexrÚ   rÝ   r.   ÚcprÕ   Ú	file_nameÚjar_iterrß   rŸ   rà   rò   s                    @r   Úfind_jar_iterrÿ   ¬  su  øé € ô* �l¤C×(Ñ(Ð(Ð(Ü˜*¤c×*Ñ*Ð*Ð*Ü�(œC× Ñ Ø—>‘>Ó#ˆØ€Gð ˆ}œt H›~Ñ-€Hð ÑÜ�7‰7�>‰>˜+×&Ñ&ØˆGØÓäØ! , ¨}¸[¸MÐJóð ô
 ˆØ”b—j‘jÕ Ø˜+Ô%ÜŸJ™J {Ñ3�	Ø#Ÿ/™/¬"¯'©'¯/©/×:�BÜŸ™×+Ñ+¨BÓ/�BÜ—w‘w—~‘~ b×)Ñ)Ü#%§7¡7×#3Ñ#3°BÓ#7˜æ$Ü "§¢¨× @Ñ @Þ$,°Ó1Iæ&Ü %¨°¨~¸RÀ¸tÀ1Ð&EÔ FØ&*˜GØ"$šHä—w‘w—}‘} R×(Ó(Þ'Ü!Ÿw™wŸ~™~¬b¯g©g¯l©l¸2Ó.L×MÑMÞ#*Ü$)¨G°L°>ÀÀBÀ4ÀqÐ*IÔ$JØ*. Ü&(§g¡g§l¡l°2Ó&DÕ Dò	  Nô .0¯ZªZ¸®^ 	Ü#%§8¢8¨L×#DÓ#DÞ'.Ý(-ó 1=Ü02·±·±¸RÖ0Kð-.ô)*ð /3 GÜ*,¯'©'¯,©,°rÓ*EÔ$Eô .<ô/ ;ôJ Ÿ'™'×,Ñ,¬R¯Z©Z¸Ñ-@ÓA�ô —w‘w—}‘} W×-Ñ-ô	ä+-¯:ª:°gÔ+>ôð
 "˜ð ó $,�KÜ—w‘w—~‘~ k×2Ó2Ü#%§7¡7×#3Ñ#3°KÓ#@˜æ$Ü "§¢¨× @Ñ @ß$, H°Õ1Iæ&Ü %¨°¨~¸RÀ¸}ÈAÐ&NÔ OØ&*˜GØ"-Ô-ô $,ñe ô@  ˆ	ÞÜŸJšJ yÖ1�Ü Ÿg™gŸl™l¨9Ó?�Ü—7‘7—>‘> +×.Ñ.Ü—x’x ×7Ñ7Þ"Ü! G¨H¨:°R¸°}ÀAÐ"FÔGØ�Ø!Ô!ó 2ô Ÿ'™'Ÿ,™, yÓ?ˆKÜ�w‰w�~‰~˜k×*Ó*ÞÜ˜G L >°°K°=ÀÐBÔCØ�Ø!Õ!ñ!  ö$ à+¨lÑ:ˆÞØÐ5¸À¹ÑCÑCˆCÜ�mŠm˜C #™I°dÈdÑSˆÞØÐ'Ñ'ˆCØ�2—7‘7Ñ@±ZÓ@Ó@Ñ@ˆCÞØÐF×MÑMØØóñ ˆCð ˆÜ˜D   R¨ u¨B¨s¨eÐ4Ó5Ð5ð ùs6   ƒB<WÃDWÇB<WÊDWÎ(AWÏ2WÏ9DWÔB5Wc                 ó0   • [        [        XX#XEU5      5      $ r7   )rä   rÿ   )rú   rñ   r   rÖ   rØ   r	   rû   s          r   Úfind_jarr  :  s"   € ô ÜØ x¸SÈ8ó	
óð r   c                 óê   • [         R                  " U 5       VVVVs/ s HD  u  pn[        R                  " US5        H"  n[         R                  R                  X5      PM$     MF     snnnn$ s  snnnnf )Nz*.jar)r#   ÚwalkÚfnmatchÚfilterr$   r&   )Úpath_to_jarsÚrootÚdirnamesÚ	filenamesrÕ   s        r   Úfind_jars_within_pathr
  J  s\   € ô *,¯ª°Ô)>öâ)>Ñ%ˆD˜IÜŸš y°'×:ˆHô 	�‰�‰�TÖ$á:ñ 	%Ù)>ôð ùõ s   œAA-
c                 óÔ   • [        U [        5      (       d  U $ [        [        R                  S[
        R                  " 5       5      nUc  U R                  5       $ U R                  U5      $ )z/Convert data read from stdout/stderr to unicodeÚencoding)r   ÚbytesÚgetattrÚsysÚ
__stdout__ÚlocaleÚgetpreferredencodingÚdecode)Ú
stdoutdatar  s     r   r+   r+   R  sV   € ä�j¤%×(Ñ(ØÐä”s—~‘~ z´6×3NÒ3NÓ3PÓQ€HØÑØ× Ñ Ó"Ð"Ø×Ñ˜XÓ&Ð&r   c                 ó¾   • [         R                  n[         R                   Vs/ s H  o"S;  d  M
  UPM     sn[         l        [        U 5      nU[         l        U$ s  snf )a¥  
When python is run from within the nltk/ directory tree, the
current directory is included at the beginning of the search path.
Unfortunately, that means that modules within nltk can sometimes
shadow standard library modules.  As an example, the stdlib
'inspect' module will attempt to import the stdlib 'tokenize'
module, but will instead end up importing NLTK's 'tokenize' module
instead (causing the import to fail).
)r}   rÁ   )r  r$   Ú
__import__)ÚmoduleÚold_pathrÇ   rW   s       r   Úimport_from_stdlibr  b  sG   € ô �x‰x€HÜŸ8š8Ó:š8�a°	Ñ'9—™8Ñ:„C„HÜ�6Ó€AØ„C„HØ€Hùò ;s
   £	A°Ac                   ó”   • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rS rS rS rS rS rS rS rS rSS jrS rS rS rSrg)ÚElementWrapperix  a~  
A wrapper around ElementTree Element objects whose main purpose is
to provide nicer __repr__ and __str__ methods.  In addition, any
of the wrapped Element's methods that return other Element objects
are overridden to wrap those values before returning them.

This makes Elements more convenient to work with in
interactive sessions and doctests, at the expense of some
efficiency.
c                 ób   • [        U[        5      (       a  U$ [        R                  [        5      $ )z…
Create and return a wrapper around a given Element object.
If ``etree`` is an ``ElementWrapper``, then ``etree`` is
returned as-is.
)r   r  r¬   r­   )rr   Úetrees     r   r­   ÚElementWrapper.__new__…  s%   € ô �eœ^×,Ñ,ØˆLä—>‘>¤.Ó1Ð1r   c                 óv   • [        U[        5      (       a  [        R                  " U5      nXR                  S'   g)a  
Initialize a new Element wrapper for ``etree``.

If ``etree`` is a string, then it will be converted to an
Element object using ``ElementTree.fromstring()`` first:

    >>> ElementWrapper("<test></test>")
    <Element "<?xml version='1.0' encoding='utf8'?>\n<test />">

Ú_etreeN)r   r   r   Ú
fromstringrn   )r<   r  s     r   r9   ÚElementWrapper.__init__�  s-   € ô �eœS×!Ñ!Ü×*Ò*¨5Ó1ˆEØ"'�‰�hÒr   c                 ó   • U R                   $ )z4
Return the Element object wrapped by this wrapper.
©r   r@   s    r   ÚunwrapÚElementWrapper.unwrapŸ  s   € ð �{‰{Ðr   c                 óè   • [         R                  " U R                  SS9R                  S5      n[	        U5      S:”  a1  UR                  S5      n[	        U5      U-
  S:”  a  SnUS S  SXS   3nSU-  $ )	NÚutf8©r  é<   Ú<é   iìÿÿÿz...z<Element %r>)r   Útostringr   r  ro   Úrfind)r<   rU   rZ   s      r   Ú__repr__ÚElementWrapper.__repr__©  su   € Ü× Ò  §¡°vÑ>×EÑEÀfÓMˆÜˆq‹6�B‹;Ø—‘˜“ˆAÜ�A“˜‘
˜bÓ Ø�Ø�S�b�6�(˜#˜a ˜e˜WÐ%ˆAØ Ñ!Ð!r   c                 óz   • [         R                  " U R                  SS9R                  S5      R	                  5       $ )z[
:return: the result of applying ``ElementTree.tostring()`` to
the wrapped Element object.
r(  r)  )r   r-  r   r  r…   r@   s    r   rA   ÚElementWrapper.__str__²  s1   € ô × Ò  §¡°vÑ>×EÑEÀfÓM×TÑTÓVð	
r   c                 ó.   • [        U R                  U5      $ r7   )r  r   )r<   Úattribs     r   Ú__getattr__ÚElementWrapper.__getattr__¿  s   € Ü�t—{‘{ FÓ+Ð+r   c                 ó.   • [        U R                  X5      $ r7   )Úsetattrr   )r<   ÚattrÚvalues      r   Ú__setattr__ÚElementWrapper.__setattr__Â  s   € Ü�t—{‘{ DÓ0Ð0r   c                 ó.   • [        U R                  U5      $ r7   )Údelattrr   )r<   r9  s     r   Ú__delattr__ÚElementWrapper.__delattr__Å  s   € Ü�t—{‘{ DÓ)Ð)r   c                 ó    • X R                   U'   g r7   r$  )r<   ÚindexÚelements      r   Ú__setitem__ÚElementWrapper.__setitem__È  s   € Ø$�‰�EÒr   c                 ó   • U R                   U	 g r7   r$  ©r<   rB  s     r   Ú__delitem__ÚElementWrapper.__delitem__Ë  s   € Ø�K‰K˜Ñr   c                 ó   • X0R                   X& g r7   r$  )r<   ÚstartÚstopÚelementss       r   Ú__setslice__ÚElementWrapper.__setslice__Î  s   € Ø"*�‰�EÑr   c                 ó    • U R                   X2	 g r7   r$  )r<   rK  rL  s      r   Ú__delslice__ÚElementWrapper.__delslice__Ñ  s   € Ø�K‰K˜˜
Ñ#r   c                 ó,   • [        U R                  5      $ r7   )ro   r   r@   s    r   Ú__len__ÚElementWrapper.__len__Ô  s   € Ü�4—;‘;ÓÐr   c                 ó2   • [        U R                  U   5      $ r7   )r  r   rG  s     r   Ú__getitem__ÚElementWrapper.__getitem__Û  s   € Ü˜dŸk™k¨%Ñ0Ó1Ð1r   c                 ó\   • U R                   X  Vs/ s H  n[        U5      PM     sn$ s  snf r7   ©r   r  )r<   rK  rL  Úelts       r   Ú__getslice__ÚElementWrapper.__getslice__Þ  s*   € Ø/3¯{©{¸5Ñ/FÓGÒ/F¨”˜sÖ#Ñ/FÑGÐGùÒGs   ‘)c                 óX   • U R                    Vs/ s H  n[        U5      PM     sn$ s  snf r7   rZ  )r<   r[  s     r   ÚgetchildrenÚElementWrapper.getchildrená  s#   € Ø/3¯{ª{Ó;ª{¨”˜sÖ#©{Ñ;Ð;ùÒ;s   �'Nc                 óF   • S U R                   R                  U5       5       $ )Nc              3   ó8   #   • U  H  n[        U5      v •  M     g 7fr7   )r  )rÆ   r[  s     r   rÈ   Ú-ElementWrapper.getiterator.<locals>.<genexpr>å  s   é € ÐLÒ/K¨”˜s×#Ð#Ò/Kùs   ‚)r   Úgetiterator)r<   Útags     r   rd  ÚElementWrapper.getiteratorä  s   € ÙL¨t¯{©{×/FÑ/FÀsÔ/KÓLÐLr   c                 óJ   • [        U R                  R                  X5      5      $ r7   )r  r   Úmakeelement)r<   re  r4  s      r   rh  ÚElementWrapper.makeelementç  s   € Ü˜dŸk™k×5Ñ5°cÓBÓCÐCr   c                 óX   • U R                   R                  U5      nUc  U$ [        U5      $ r7   )r   Úfindr  ©r<   r$   r[  s      r   rk  ÚElementWrapper.findê  s+   € Ø�k‰k×Ñ˜tÓ$ˆØ‰;ØˆJä! #Ó&Ð&r   c                 óv   • U R                   R                  U5       Vs/ s H  n[        U5      PM     sn$ s  snf r7   )r   r†   r  rl  s      r   r†   ÚElementWrapper.findallñ  s0   € Ø/3¯{©{×/BÑ/BÀ4Ô/HÓIÒ/H¨”˜sÖ#Ñ/HÑIÐIùÒIs   ž6rI   r7   )rC   rD   rE   rF   rG   r­   r9   r%  r/  rA   r5  r;  r?  rD  rH  rN  rQ  rT  rW  r\  r_  rd  rh  rk  r†   rH   rI   r   r   r  r  x  so   † ñ	ò	2ò(òò"ò
ò,ò1ò*ò%òò+ò$ò ò2òHò<ôMòDò'õJr   r  c                 óB  • UR                   UR                  pCU(       aJ  UR                  nUc  SnUS:  a  [        U [	        XC5      5      u  p4O[        U [	        X45      5      u  p4X4U4$ UR                  S;  a"  [        SU R                  R                  -  5      eUc  SnUc  [        U 5      nUS:  a  [        S[        U 5      U-   5      nUS:  a  [        S[        U 5      U-   5      nUS:”  a   XS-
       [        X45      nX44$ ! [         a    [        U 5      n N%f = f)aÔ  
Given a slice, return the corresponding (start, stop) bounds,
taking into account None indices and negative indices.  The
following guarantees are made for the returned start and stop values:

  - 0 <= start <= len(sequence)
  - 0 <= stop <= len(sequence)
  - start <= stop

:raise ValueError: If ``slice_obj.step`` is not None.
:param allow_step: If true, then the slice object may have a
    non-None step.  If it does, then return a tuple
    (start, stop, step).
rK   r   r¹   z)slices with steps are not supported by %s)rK  rL  ÚstepÚslice_boundsÚslicer8   rl   rC   ro   ÚmaxÚ
IndexErrorrˆ   )ÚsequenceÚ	slice_objÚ
allow_steprK  rL  rq  s         r   rr  rr  ú  s2  € ð —?‘? I§N¡Nˆ4ö Ø�~‰~ˆØ‰<ØˆDð �!‹8Ü& x´°tÓ1CÓD‰KˆE�4ä& x´°uÓ1CÓD‰KˆEØ˜DÐ Ð ð 
�‰˜yÓ	(ÜØ7¸(×:LÑ:L×:UÑ:UÑUó
ð 	
ð
 �}ØˆØ�|Ü�8‹}ˆð ˆqƒyÜ�A”s˜8“} uÑ,Ó-ˆØˆaƒxÜ�1”c˜(“m dÑ*Ó+ˆð
 ˆaƒxð	!Ø˜A‘XÒô
 �Ó€Eð ˆ;Ðøô ó 	!Ü�x“=ŠDð	!ús   Ã1D ÄDÄDc                 óâ  • [         R                  R                  U 5      (       d  g[        [         S5      (       aµ  [         R                  " U 5      n[        R
                  " UR                  5      nUS-  (       a  gUR                  [         R                  " 5       :X  a  US-  (       a  gUR                  [         R                  " 5       /[         R                  " 5       -   ;   a  US-  (       a  ggg)NFÚgetuidrc   Té€   é   )r#   r$   rÑ   ÚhasattrÚstatÚS_IMODEÚst_modeÚst_uidrz  Úst_gidÚgetgidÚ	getgroups)r$   ÚstatdataÚperms      r   Úis_writabler‡  A  sŸ   € ä�7‰7�>‰>˜$×ÑØô Œr�8×ÑÜ—7’7˜4“=ˆÜ�|Š|˜H×,Ñ,Ó-ˆà�%�<Øà�_‰_¤§	¢	£Ó+°¸·Øà�o‰o¤"§)¢)£+ ´·²³Ñ!?Ó?ÀdÈUÇlØð ð r   c           
      ó~   • [        S[        U5      R                  < SU < S[        U5      R                  < S35      e)Nzunorderable types: z() Ú z())r"   rv   rC   )ÚorderingÚaÚbs      r   Úraise_unorderable_typesr�  a  s/   € Ý
ä�‹7×Ô›X¤t¨A£w×'7Ô'7ð	9óð r   )NNF)NNNNT)rI   rI   NNFF)rI   rI   NNF)NrI   rI   NNF)NrI   rI   NFF)F)-r  r  r#   rP   r~  r   r  r‰   ri   r™   Ú	xml.etreer   r   r   r   r   r8   r4   rQ   rM   r[   r^   ra   re   rg   rt   rm   r�   r¢   r¨   r²   rá   ræ   rè   rì   r   rÿ   r  r
  r+   r  r  rr  r‡  r�  rI   r   r   Ú<module>r�     s†  ðó Û Û 	Û 	Û Û Û 
Û Û Û Ý !ð €	Ø€ô&ô@Wô~>�
ô >ð  —:’:Ð@ÓAÐ ò8Hðv �zŠz˜(Ó#€ò #ðF —Z’ZÐ 4Ó5Ð ò#'òV8ò>ò.ò*÷@)#ñ )#÷b
ñ 
ð( ØØØØØô@6ðH NSôð NSôð ØØØØØôð6 ØØØØØôð$ ØØØØØôK6ð` ØØØØØôò ò'ò ÷,zJñ zJôD?òNó@r   