
B_Kc           @   s'  d  d k  Z  d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k	 l
 Z
 y d  d k l Z Wn# e j
 o d  d k l Z n Xd   Z d a g  a d d d  Z d d d d e d  Z e i i e i i e i i e
  d d	   Z d
 e f d     YZ e i d  Z d   Z  e i d  Z! d   Z" e i d  Z# d   Z$ d   Z% d   Z& d   Z' d   Z( d e) f d     YZ* d d! d     YZ+ d d" d# d d e d  Z, d   Z- d   Z. d e) f d     YZ/ d   Z0 d    Z1 d S($   iN(   t   __file__(   t   cElementTree(   t   ElementTreec         C   sk   xL t  i d |   D]8 } | d d j p | d j o t d |    q q Wd   } t  i d | |   S(   s  
    Convert all grouping parenthases in the given regexp pattern to
    non-grouping parenthases, and return the result.  E.g.:

        >>> convert_regexp_to_nongrouping('ab(c(x+)(z*))?d')
        'ab(?:c(?:x+)(?:z*))?d'

    @type pattern: C{str}
    @rtype: C{str}
    s
   \\.|\(\?P=i   t
   0123456789s   (?P=s>   Regular expressions with back-references are not supported: %rc         S   s   t  i d d |  i    S(   Ns   ^\((\?P<[^>]*>)?$s   (?:(   t   ret   subt   group(   t   m(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   subfunc0   s    s   (?x)
        \\.           |  # Backslashed character
        \(\?P<[^>]*>  |  # Named group
        \(\?          |  # Extension group
        \(               # Grouping parenthasis(   R   t   findallt
   ValueErrorR   (   t   patternt   sR   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   convert_regexp_to_nongrouping   s     	c         C   s\   t  d |  d d d g a | d j	 o0 t | t  o | i   } n t |  a n d S(   s	  
    Configure nltk's java interface, by letting nltk know where it can
    find the C{java} binary, and what extra options (if any) should be
    passed to java when it is run.

    @param bin: The full path to the C{java} binary.  If not specified,
        then nltk will search the system for a C{java} binary; and if
        one is not found, it will raise a C{LookupError} exception.
    @type bin: C{string}
    @param options: A list of options that should be passed to the
        C{java} binary when it is called.  A common value is
        C{['-Xmx512m']}, which tells the C{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: C{list} of C{string}
    t   javat   env_varst   JAVAHOMEt	   JAVA_HOMEN(   t   find_binaryt	   _java_bint   Nonet
   isinstancet
   basestringt   splitt   listt   _java_options(   t   bint   options(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   config_javaF   s
    c         C   sI  | d j o t  i } n | d j o t  i } n | d j o t  i } n t |  t  o t d   n t t j o t   n | t j o
 t } n | d t 7} t	 |   }  d | g |  }  t g t
 |  }  t  i |  d | d | d | } | p | Sn | i   \ } } | i d j o | GHt d	   n | | f S(
   s  
    Execute the given java command, by opening a subprocess that calls
    C{java}.  If java has not yet been configured, it will be configured
    by calling L{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: C{list} of C{string}

    @param classpath: A C{':'} separated list of directories, JAR
        archives, and ZIP archives to search for class files.
    @type classpath: C{string}

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

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

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

    @raise OSError: If the java command returns a nonzero return code.
    t   pipes   cmd should be a list of stringst   :s   -cpt   stdint   stdoutt   stderri    s   Java command failed!(   t
   subprocesst   PIPER   R   t	   TypeErrorR   R   R   t   NLTK_JARR   R   t   Popent   communicatet
   returncodet   OSError(   t   cmdt	   classpathR   R    R!   t   blockingt   p(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyR   _   s(    )
!i    s   nltk.jart
   ParseErrorc           B   s    e  Z d  Z d   Z d   Z RS(   s   
    Exception raised by parse_* functions when they fail.
    @param position: The index in the input string where an error occured.
    @param expected: What was expected when an error occured.
    c         C   s)   t  i |  | |  | |  _ | |  _ d  S(   N(   R
   t   __init__t   expectedt   position(   t   selfR0   R1   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyR/      s    	c         C   s   d |  i  |  i f S(   Ns   Expected %s at %s(   R0   R1   (   R2   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   __str__   s    (   t   __name__t
   __module__t   __doc__R/   R3   (    (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyR.      s   	s   [uU]?[rR]?(\"\"\"|\'\'\'|\"|\')c         C   s  t  i |  |  } | p t d |   n | i d  } t i d |  } | i   } xc t o[ | i |  |  } | p t d |   n | i d  d j o | i   d } q] Pq] Wy' t	 |  | | i   ! | i   f SWn( t
 j
 o } t d | t   n Xd S(	   s   
    If a Python string literal begins at the specified position in the
    given string, then return a tuple C{(val, end_position)}
    containing the value of the string literal and the position where
    it ends.  Otherwise, raise a L{ParseError}.
    s
   open quotei   s   \\|%ss   close quotei    s   \s   valid string (%s)N(   t   _STRING_START_REt   matchR.   R   R   t   compilet   endt   Truet   searcht   evalR
   t   start(   R   t   start_positionR   t	   quotemarkt   _STRING_END_RER1   R8   t   e(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt	   parse_str   s    
*'s   -?\d+c         C   sH   t  i |  |  } | p t d |   n t | i    | i   f S(   s   
    If an integer begins at the specified position in the given
    string, then return a tuple C{(val, end_position)} containing the
    value of the integer and the position where it ends.  Otherwise,
    raise a L{ParseError}.
    t   integer(   t   _PARSE_INT_RER8   R.   t   intR   R:   (   R   R?   R   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt	   parse_int   s    s   -?(\d*)([.]?\d*)?c         C   s   t  i |  |  } | p! | i d  p | i d  o t d |   n | i d  o  t | i    | i   f Sn t | i    | i   f Sd S(   s   
    If an integer or float begins at the specified position in the
    given string, then return a tuple C{(val, end_position)}
    containing the value of the number and the position where it ends.
    Otherwise, raise a L{ParseError}.
    i   i   t   numberN(   t   _PARSE_NUMBER_VALUER8   R   R.   t   floatR:   RF   (   R   R?   R   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   parse_number   s
    )0c         C   s   t  |  t i  or |  i d j	 ob |  i } g  } t |  i  D]( } | | i j o | | i | q@ q@ ~ } t |  d j Sn t	 d   d S(   s  
    @return: True if C{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
    i   s   Expected an instance method.N(
   R   t   typest
   MethodTypet   im_classR   R4   t   _mrot   __dict__t   lenR$   (   t   methodt   namet   _[1]t   clst   funcs(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt
   overridden
  s    #	+c         C   sS   t  |  t  o |  i Sn5 |  g } x$ |  i D] } | i t |   q. W| Sd S(   sX  
    Return the I{method resolution order} for C{cls} -- i.e., a list
    containing C{cls} and all its base classes, in the order in which
    they would be checked by C{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 C{__bases__}.
    N(   R   t   typet   __mro__t	   __bases__t   extendRO   (   RU   t   mrot   base(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyRO   '  s    	
 c      	   C   s   d } |  i  oL |  i  i   d |  _  t i d |  i  i    } | o t |  } qe n
 d |  _  |  i  t i d | | f d | d | d 7_  d S(	   s4   Add an epytext @field to a given object's docstring.t    s   

s   (?<=\n)[ ]+(?!\s)s   @%s: %st   initial_indentt   subsequent_indents       N(   R6   t   rstripR   R	   t
   expandtabst   mint   textwrapt   fill(   t   objt   fieldt   messaget   indentt   indents(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   _add_epytext_field;  s    
	c            s     f d   } | S(   s   
    A decorator used to mark functions as deprecated.  This will cause
    a warning to be printed the when the function is used.  Usage:

      >>> @deprecated('Use foo() instead')
      >>> def bar(x):
      ...     print x/10
    c            s   d   i   f  d t i  d d d d     f d   } | i i   i    i  | _    i | _ t | _ t | d   | S(   Ns&   Function %s() has been deprecated.  %ss   
R_   s     R`   c             s&   t  i  d t d d   |  |   S(   Nt   categoryt
   stackleveli   (   t   warningst   warnt   DeprecationWarning(   t   argst   kwargs(   t   funct   msg(    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   newFuncZ  s    t
   deprecated(	   R4   Rd   Re   RP   t   updateR6   R;   t   __deprecated__Rk   (   Rs   Ru   (   Rh   (   Rs   Rt   s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt	   decoratorU  s    
	(    (   Rh   Ry   (    (   Rh   s$   /p/zhu/06/nlp/nltk/nltk/internals.pyRv   L  s    	t
   Deprecatedc           B   s   e  Z d  Z d   Z RS(   sK  
    A base class used to mark deprecated classes.  A typical usage is to
    alert users that the name of a class has changed:

        >>> class OldClassName(Deprecated, NewClassName):
        ...     "Use NewClassName instead."

    The docstring of the deprecated class will be used in the
    deprecation warning message.
    c      	   O   s  d  } x/ t |   D]! } t | i j o | } Pq q W| p
 t d  | i p
 d i   } t i d d |  } t i d d |  } d | i	 } |  | j o | d |  i	 7} n d | | f } d t
 i | d	 d
 d d
 } t i | d t d d t i |  | |  S(   Ns-   Unable to determine which base is deprecated.R^   s   \A\s*@deprecated:s   (?m)^\s*s   Class %ss    (base class for %s)s   %s has been deprecated.  %ss   
R_   s       R`   Rl   Rm   i   (   R   RO   Rz   RZ   t   AssertionErrorR6   t   stripR   R   R4   Rd   Re   Rn   Ro   Rp   t   objectt   __new__(   RU   Rq   Rr   t   dep_clsR]   t   docRS   Rt   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyR~   s  s"     
(   R4   R5   R6   R~   (    (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyRz   h  s   
t   Counterc           B   s#   e  Z d  Z d d  Z d   Z RS(   sE   
    A counter that auto-increments each time its value is read.
    i    c         C   s   | |  _  d  S(   N(   t   _value(   R2   t   initial_value(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyR/     s    c         C   s   |  i  d 7_  |  i  S(   Ni   (   R   (   R2   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   get  s    (   R4   R5   R6   R/   R   (    (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyR     s   c         C   se  | d j o |  g } n t |  t  p t  t | t  p t  t | t  p t  t | t  o | i   } n | d j	 o t i i |  o | Sn x | D]~ } t i i t i i | |   o t i i | |  Sn t i i t i i | d |   o t i i | d |  Sq q Wt	 d |  | f   n x!| D]} | t i
 j ot i
 | } t i i |  o) | o d |  | f GHn t i
 | Sqlx | D] }	 t i i t i
 | |	  } t i i |  o" | o d |  | f GHn | Sn t i i t i
 | d |	  } t i i |  o" | o d |  | f GHn | SqqWqSqSWxO | D]G }
 x> | D]6 } t i i |
 |  } t i i |  o | SqqWqwWt i d j o x | D] } y t i d | g d t i } | i   \ } } | i   } | i |  o5 t i i |  o" | o d |  | f GHn | Sn Wqt j
 o }   qqXqWn d |  |  f } | o | d | d	 7} n t i | d
 d d d d } | d |  |  f 7} | o+ | d 7} | d i d   | D  7} n | o | d |  | f 7} n d d } t d | | | f   d S(   sp  
    Search for the binary for a program that is used by nltk.

    @param name: The name of the program
    @param path_to_bin: The user-supplied binary location, or None.
    @param env_vars: A list of environment variable names to check
    @param binary_names: A list of alternative binary names to check.
    @param searchpath: List of directories to search.
    R   s   Could not find %s binary at %ss   [Found %s: %s]t   posixt   whichR    s;   NLTK was unable to find the %s executable!  Use config_%s()s#    or set the %s environment variablei    t   .R_   s     R`   s"   

    >>> config_%s('/path/to/%s')s   

  Searched in:R^   c         s   s   x |  ] } d  | Vq Wd S(   s	   
    - %sN(    (   t   .0t   d(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pys	   <genexpr>  s    s.   

  For more information, on %s, see:
    <%s>t   =iK   s
   

%s
%s
%sN(   R   R   R   R{   R   t   ost   patht   isfilet   joinR
   t   environRS   R"   R&   R#   R'   R|   t   endswitht   existst   KeyboardInterruptRd   Re   t   LookupError(   RS   t   path_to_binR   t
   searchpatht   binary_namest   urlt   verboseR   t   env_vart   bin_namet	   directoryR-   R    R!   R   t
   SystemExitRt   t   div(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyR     s     "%  	   #	
!
c         C   sZ   t  i } g  } t  i D] } | d j o | | q q ~ t  _ t |   } | t  _ | S(   s  
    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 'tokenzie'
    module, but will instead end up importing NLTK's 'tokenize' module
    instead (causing the import to fail).
    R^   R   (   R^   R   (   t   sysR   t
   __import__(   t   modulet   old_pathRT   R   R   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   import_from_stdlib  s
    
	8	c         B   s   e  d  } | i |   \ } } } } d |  i } | i | | | d  } d | | f d U|  i e _ |  i e _ |  i e _ e e _ e	 e d d  e S(   s;  
    A decorator used to mark methods as abstract.  I.e., methods that
    are marked by this decorator must be overridden by subclasses.  If
    an abstract method is called (either in the base class or in a
    subclass that does not override the base class method), it will
    raise C{NotImplementedError}.
    t   inspects   %s is an abstract method.s,   def newfunc%s: raise NotImplementedError(%r)Nt   notes   This method is abstract.(    (
   R   t
   getargspecR4   t   formatargspect   func_defaultst   newfuncR6   R;   t   __abstract__Rk   (   Rs   R   Rq   t   varargst   varkwt   defaultsRt   t	   signature(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   abstract  s    		t   ElementWrapperc           B   s   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z e d  Z d   Z d   Z d   Z RS(   s  
    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         C   s,   t  | t  o | Sn t i t |  Sd S(   s   
        Create and return a wrapper around a given Element object.
        If C{etree} is an C{ElementWrapper}, then C{etree} is
        returned as-is.
        N(   R   R   R}   R~   (   RU   t   etree(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyR~   C  s    c         C   s4   t  | t  o t i |  } n | |  i d <d S(   s   
        Initialize a new Element wrapper for C{etree}.  If
        C{etree} is a string, then it will be converted to an
        Element object using C{ElementTree.fromstring()} first.
        t   _etreeN(   R   R   R   t
   fromstringRP   (   R2   R   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyR/   N  s    c         C   s   |  i  S(   sD   
        Return the Element object wrapped by this wrapper.
        (   R   (   R2   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   unwrapX  s    c         C   sy   t  i |  i  } t |  d j oL | i d  } t |  | d j o
 d } n d | d  | | f } n d | S(   Ni<   t   <i   is   %s...%ss   <Element %r>(   R   t   tostringR   RQ   t   rfind(   R2   R   RB   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   __repr__b  s    !c         C   s   t  i |  i  i   S(   sr   
        @return: the result of applying C{ElementTree.tostring()} to
        the wrapped Element object.
        (   R   R   R   Ra   (   R2   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyR3   j  s    c         C   s   t  |  i |  S(   N(   t   getattrR   (   R2   t   attrib(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   __getattr__u  s    c         C   s   t  |  i | |  S(   N(   t   setattrR   (   R2   t   attrt   value(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   __setattr__x  s    c         C   s   t  |  i |  S(   N(   t   delattrR   (   R2   R   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   __delattr__{  s    c         C   s   | |  i  | <d  S(   N(   R   (   R2   t   indext   element(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   __setitem__~  s    c         C   s   |  i  | =d  S(   N(   R   (   R2   R   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   __delitem__  s    c         C   s   | |  i  | | +d  S(   N(   R   (   R2   R>   t   stopt   elements(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   __setslice__  s    c         C   s   |  i  | | 5d  S(   N(   R   (   R2   R>   R   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   __delslice__  s    c         C   s   t  |  i  S(   N(   RQ   R   (   R2   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   __len__  s    c         C   s   t  |  i |  S(   N(   R   R   (   R2   R   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   __getitem__  s    c         C   s/   g  } |  i  | | !D] } | t |  q ~ S(   N(   R   R   (   R2   R>   R   RT   t   elt(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   __getslice__  s    c         C   s(   g  } |  i  D] } | t |  q ~ S(   N(   R   R   (   R2   RT   R   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   getchildren  s    c         C   s   d   |  i  i |  D S(   Nc         s   s   x |  ] } t  |  Vq Wd  S(   N(   R   (   R   R   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pys	   <genexpr>  s   	(   R   t   getiterator(   R2   t   tag(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyR     s    c         C   s   t  |  i i | |   S(   N(   R   R   t   makeelement(   R2   R   R   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyR     s    c         C   s5   |  i  i |  } | d  j o | Sn t |  Sd  S(   N(   R   t   findR   R   (   R2   R   R   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyR     s    c         C   s1   g  } |  i  i |  D] } | t |  q ~ S(   N(   R   R	   R   (   R2   R   RT   R   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyR	     s    (   R4   R5   R6   R~   R/   R   R   R3   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R	   (    (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyR   6  s*   
		
	
															c         C   s!  | i  t j	 o t d |  i i   n | i | i } } | t j o
 d } n | t j o t |   } n | d j  o t d t |   |  } n | d j  o t d t |   |  } n | d j o6 y |  | d Wqt	 j
 o t |   } qXn t
 | |  } | | f S(   sl  
    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 C{slice_obj.step} is not C{None}.
    s)   slices with steps are not supported by %si    i   (   t   stepR   R
   t	   __class__R4   R>   R   RQ   t   maxt
   IndexErrorRc   (   t   sequencet	   slice_objR>   R   (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   slice_bounds  s    **#c         C   s   t  i i |   p t Sn t t  d  o t  i |   } t i | i  } | d @o t Sq | i	 t  i
   j o | d @o t Sq | i t  i   j o | d @o t Sq t Sn t S(   Nt   getuidi   i   i   (   R   R   R   t   Falset   hasattrt   statt   S_IMODEt   st_modeR;   t   st_uidR   t   st_gidt   getgid(   R   t   statdatat   perm(    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pyt   is_writable  s    !!(    (    (    (2   R"   R   t   os.pathR   Rn   Rd   RL   R   R   t   nltkR    t	   xml.etreeR   R   t   ImportErrort
   nltk.etreeR   R   R   R   R   R;   R   R   t   abspathR   R   R%   R
   R.   R9   R7   RC   RE   RG   RI   RK   RW   RO   Rk   Rv   R}   Rz   R   R   R   R   R   R   R   (    (    (    s$   /p/zhu/06/nlp/nltk/nltk/internals.pys   <module>	   sP   #	&L%							*	[		%w	*