
    Of                         S SK r S SKJr  S SKrS SKJr  S r/ SQrSSSS	S
S-  /r\R                  R                  S\5      S 5       rS rSS jrg)    N)BytesIO)SeekableUnicodeStreamReaderc                    U R                  U5      n[        U5      n[        X15      nUR                  5       S:X  d   eU SR	                  UR                  5       5      :X  d   eUR                  S[        R                  5        UR                  5       UR                  5       :X  d   eUR                  S5        SnS nUS:w  a  UR                  S5      nXV-  nUS:w  a  M  X:X  d   eg )Nr       )
encoder   r   telljoin	readlinesseekosSEEK_ENDread)unicode_stringencodingbytestrstreamreadercontentschars          T/usr/lib/python3/dist-packages/nltk/test/unit/test_seekable_unicode_stream_reader.pycheck_readerr   	   s    ##H-GWF(:F ;;=A RWWV%5%5%78888 KK2;;;;=FKKM)))
KKN HD
"*{{1~ "* %%%    )asciilatin1greekhebrewzutf-16zutf-8z6
    This is a test file.
    It is fairly short.
    u(   This file can be encoded with latin1. u^       This is a test file.
    Here's a blank line:

    And here's some unicode: î ģ ￣
    uG       This is a test file.
    Unicode characters: ó ∢ ㌳䑄 啕
    u       This is a larger file.  It has some lines that are longer     than 72 characters.  It's got lots of repetition.  Here's     some unicode chars: î ģ ￣  ⍅

    How fun!  Let's repeat it twenty times.
       stringc                 z    [          H   n U R                  U5        [        X5        M"     g ! [         a     M2  f = fN)	ENCODINGSr   UnicodeEncodeErrorr   )r   r   s     r   test_readerr$   A   s;    	MM(# 	V&  " 		s   ,
::c                      [        [        S5      S5      n U R                  R                  (       a   eU R	                  5         U R                  R                  (       d   eg )Nr   r   )r   r   r   closed__del__)r   s    r   &test_reader_stream_closes_when_deletedr(   L   sB    (w?F}}####
NN==r   c                 ,    SS K nUR                  5         g )Nr   )gccollect)moduler*   s     r   teardown_moduler-   S   s    JJLr   r!   )r   ior   pytestnltk.corpus.readerr   r   r"   STRINGSmarkparametrizer$   r(   r-    r   r   <module>r5      sw    	   :&6 F	 1 		!6 7+' ,' r   