+
    ÖÇÜhŽ  ã                   óŒ   € R t ^ RIHtHt ^ RIHtHt  ! R R]4      t ! R R]4      t ! R R]4      t	 ! R	 R
]4      t
RR ltR# )aÔ  
Simple Tokenizers

These tokenizers divide strings into substrings using the string
``split()`` method.
When tokenizing using a particular delimiter string, use
the string ``split()`` method directly, as this is more efficient.

The simple tokenizers are *not* available as separate functions;
instead, you should just use the string ``split()`` method directly:

    >>> s = "Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\n\nThanks."
    >>> s.split() # doctest: +NORMALIZE_WHITESPACE
    ['Good', 'muffins', 'cost', '$3.88', 'in', 'New', 'York.',
    'Please', 'buy', 'me', 'two', 'of', 'them.', 'Thanks.']
    >>> s.split(' ') # doctest: +NORMALIZE_WHITESPACE
    ['Good', 'muffins', 'cost', '$3.88\nin', 'New', 'York.', '',
    'Please', 'buy', 'me\ntwo', 'of', 'them.\n\nThanks.']
    >>> s.split('\n') # doctest: +NORMALIZE_WHITESPACE
    ['Good muffins cost $3.88', 'in New York.  Please buy me',
    'two of them.', '', 'Thanks.']

The simple tokenizers are mainly useful because they follow the
standard ``TokenizerI`` interface, and so can be used with any code
that expects a tokenizer.  For example, these tokenizers can be used
to specify the tokenization conventions when building a `CorpusReader`.

)ÚStringTokenizerÚ
TokenizerI)Úregexp_span_tokenizeÚstring_span_tokenizec                   ó   € ] tR t^*tRtRtRtR# )ÚSpaceTokenizera²  Tokenize a string using the space character as a delimiter,
which is the same as ``s.split(' ')``.

    >>> from nltk.tokenize import SpaceTokenizer
    >>> s = "Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\n\nThanks."
    >>> SpaceTokenizer().tokenize(s) # doctest: +NORMALIZE_WHITESPACE
    ['Good', 'muffins', 'cost', '$3.88\nin', 'New', 'York.', '',
    'Please', 'buy', 'me\ntwo', 'of', 'them.\n\nThanks.']
Ú © N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú_stringÚ__static_attributes__r	   ó    Ú6/usr/lib/python3/dist-packages/nltk/tokenize/simple.pyr   r   *   s   † ñð „Gr   r   c                   ó   € ] tR t^8tRtRtRtR# )ÚTabTokenizerzÐTokenize a string use the tab character as a delimiter,
the same as ``s.split('\t')``.

    >>> from nltk.tokenize import TabTokenizer
    >>> TabTokenizer().tokenize('a\tb c\n\t d')
    ['a', 'b c\n', ' d']
Ú	r	   Nr
   r	   r   r   r   r   8   s   † ñð „Gr   r   c                   ó4   a € ] tR t^Dt o RtRtR tR tRtV t	R# )ÚCharTokenizerz|Tokenize a string into individual characters.  If this functionality
is ever required directly, use ``for char in string``.
Nc                ó   € \        V4      # ©N)Úlist©ÚselfÚss   &&r   ÚtokenizeÚCharTokenizer.tokenizeK   s   € Ü�A‹wˆr   c              #  ól   "  € \        \        ^\        V4      ^,           4      4       Rj  x€L
  R#  L5i)é   N)Ú	enumerateÚrangeÚlenr   s   &&r   Úspan_tokenizeÚCharTokenizer.span_tokenizeN   s"   é € ÜœU 1¤c¨!£f¨q¥jÓ1Ó2×2Ô2ùs   ‚)4«2¬4r	   )
r   r   r   r   r   r   r   r&   r   Ú__classdictcell__©Ú__classdict__s   @r   r   r   D   s    ø‡ € ñð €Gò÷3ð 3r   r   c                   ó:   a € ] tR t^Rt o RtRR ltR tR tRtV t	R# )ÚLineTokenizeraT  Tokenize a string into its lines, optionally discarding blank lines.
This is similar to ``s.split('\n')``.

    >>> from nltk.tokenize import LineTokenizer
    >>> s = "Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\n\nThanks."
    >>> LineTokenizer(blanklines='keep').tokenize(s) # doctest: +NORMALIZE_WHITESPACE
    ['Good muffins cost $3.88', 'in New York.  Please buy me',
    'two of them.', '', 'Thanks.']
    >>> # same as [l for l in s.split('\n') if l.strip()]:
    >>> LineTokenizer(blanklines='discard').tokenize(s) # doctest: +NORMALIZE_WHITESPACE
    ['Good muffins cost $3.88', 'in New York.  Please buy me',
    'two of them.', 'Thanks.']

:param blanklines: Indicates how blank lines should be handled.  Valid values are:

    - ``discard``: strip blank lines out of the token list before returning it.
       A line is considered blank if it contains only whitespace characters.
    - ``keep``: leave all blank lines in the token list.
    - ``discard-eof``: if the string ends with a newline, then do not generate
       a corresponding token ``''`` after that newline.
c                ód   € RpW9  d"   \        RRP                  V4      ,          4      hWn        R# )ÚdiscardzBlank lines must be one of: %sr   N)r.   Úkeepúdiscard-eof)Ú
ValueErrorÚjoinÚ_blanklines)r   Ú
blanklinesÚvalid_blankliness   && r   Ú__init__ÚLineTokenizer.__init__i   s5   € Ø=ÐØÔ-ÜØ0°3·8±8Ð<LÓ3MÕMóð ð &Ör   c                ó2  € VP                  4       pV P                  R 8X  d+   V Uu. uF  q3P                  4       '       g   K  VNK  	  ppV# V P                  R8X  d6   V'       d.   VR,          P                  4       '       g   VP	                  4        V# u upi )r.   r0   éÿÿÿÿ)Ú
splitlinesr3   ÚrstripÚstripÚpop)r   r   ÚlinesÚls   &&  r   r   ÚLineTokenizer.tokenizer   st   € Ø—‘“ˆà×Ñ˜yÔ(Ù %Ó4¡˜1¯©¯—Q�Q¡ˆEÐ4ð ˆð ×Ñ Ô.ß˜U 2�YŸ_™_×.Ò.Ø—	‘	”Øˆùò	 5s   ¦BÁBc              #  óŒ   "  € V P                   R 8X  d   \        VR4       Rj  x€L
  R# \        VR4       Rj  x€L
  R#  L L5i)r/   z\nNz
\n(\s+\n)*)r3   r   r   r   s   &&r   r&   ÚLineTokenizer.span_tokenize}   s;   é € Ø×Ñ˜vÔ%Ü+¨A¨uÓ5×5Ò5ä+¨A¨}Ó=×=Ò=ñ 6á=ùs   ‚!A£A ¤A¹AºAÁA)r3   N©r.   )
r   r   r   r   r   r6   r   r&   r   r(   r)   s   @r   r,   r,   R   s   ø‡ € ñô,&ò÷>ð >r   r,   c                 ó6   € \        V4      P                  V 4      # r   )r,   r   )Útextr4   s   &&r   Úline_tokenizerF   Š   s   € Ü˜Ó$×-Ñ-¨dÓ3Ð3r   NrC   )r   Únltk.tokenize.apir   r   Únltk.tokenize.utilr   r   r   r   r   r,   rF   r	   r   r   Ú<module>rI      sH   ðñ÷: :ß Iô�_ô ô	�?ô 	ô3�Oô 3ô/>�Jô />öp4r   