
`]c           @@ s   d  Z  d d l m Z m Z d d l Z d d l m Z d d l m Z m	 Z	 d   Z
 d e j f d     YZ d	 e j f d
     YZ d S(   u@   
Unit tests for nltk.compat.
See also nltk/test/compat.doctest.
i    (   t   absolute_importt   unicode_literalsN(   t   Text(   t   PY3t   python_2_unicode_compatiblec         C@ s)   d d l  m } t r% | d   n  d  S(   Ni    (   t   SkipTestu:   test_2x_compat is for testing nltk.compat under Python 2.x(   t   noseR   R   (   t   moduleR   (    (    s<   lib/python2.7/site-packages/nltk/test/unit/test_2x_compat.pyt   setup_module   s    t   TestTextTransliterationc           B@ s2   e  Z e d  d d d g  Z d   Z d   Z RS(   u   Sãou   Toméu   andu	   Príncipec         C@ s   |  j  t |  j  d  d  S(   Ns)   <Text: S\xe3o Tom\xe9 and Pr\xedncipe...>(   t   assertEqualt   reprt   txt(   t   self(    (    s<   lib/python2.7/site-packages/nltk/test/unit/test_2x_compat.pyt	   test_repr   s    c         C@ s   |  j  t |  j  d  d  S(   Ns    <Text: Sao Tome and Principe...>(   R
   t   strR   (   R   (    (    s<   lib/python2.7/site-packages/nltk/test/unit/test_2x_compat.pyt   test_str   s    (   t   __name__t
   __module__R   R   R   R   (    (    (    s<   lib/python2.7/site-packages/nltk/test/unit/test_2x_compat.pyR	      s   	t   TestFractionc           B@ s   e  Z d    Z RS(   c      	   C@ s  d d l  m } d d l m } |  j t   | d d d t Wd  QX| d d d t } | j d k ss t  | j d k s t  t	 |  d k s t  | d d d t } | j d k s t  | j d k s t  | d d	 d t } | j d k s	t  | j d	 k st  | d d  } t	 |  t	 |  k oVt	 |  k n sat  | d
 d t | d
  k st  d  S(   Ni    (   t   Fractioni  t
   _normalizeg        i   i   i   i   gA`"	@(
   t	   fractionsR   t   nltk.compatt   assertRaisest	   TypeErrort   Falset	   numeratort   AssertionErrort   denominatort   float(   R   t   NativePythonFractiont   NLTKFractiont   compat_fract
   six_twelvet   one_twot   six_twelve_original(    (    s<   lib/python2.7/site-packages/nltk/test/unit/test_2x_compat.pyt   test_unnoramlize_fraction   s"    4(   R   R   R%   (    (    (    s<   lib/python2.7/site-packages/nltk/test/unit/test_2x_compat.pyR      s   (   t   __doc__t
   __future__R    R   t   unittestt	   nltk.textR   R   R   R   R   t   TestCaseR	   R   (    (    (    s<   lib/python2.7/site-packages/nltk/test/unit/test_2x_compat.pyt   <module>   s   	
