ó
ù`]c           @  s   d  d l  m Z d „  Z d S(   iÿÿÿÿ(   t   print_functionc         C  s%  d d d d d d d d d d d j  d ƒ d	 f } | g } xÙ t |  | ƒ D]È \ } } x¹ t | ƒ D]« \ } \ } } | | d
 }	 | |	 k rn d j d „  | |  Dƒ ƒ }
 d j d „  | | d
 Dƒ ƒ } d | |	 | f } | j d |
 d | j  d ƒ | d  f ƒ qn qn WqU W| S(   s  
    Returns a list of human-readable strings indicating the errors in the
    given tagging of the corpus.

    :param train_sents: The correct tagging of the corpus
    :type train_sents: list(tuple)
    :param test_sents: The tagged corpus
    :type test_sents: list(tuple)
    s   %25s | %s | %s
t   -i   t   +i   s   left contexts   word/test->goldi   s   right contexti   t    c         s  s   |  ] } d  | Vq d S(   s   %s/%sN(    (   t   .0t   w(    (    s5   lib/python2.7/site-packages/nltk/tbl/erroranalysis.pys	   <genexpr>%   s    c         s  s   |  ] } d  | Vq d S(   s   %s/%sN(    (   R   R   (    (    s5   lib/python2.7/site-packages/nltk/tbl/erroranalysis.pys	   <genexpr>&   s    s	   %s/%s->%ss   %25s | %s | %siçÿÿÿi   (   t   centert   zipt	   enumeratet   joint   append(   t   train_sentst
   test_sentst   hdrt   errorst
   train_sentt	   test_sentt   wordnumt   wordt	   train_post   test_post   leftt   rightt   mid(    (    s5   lib/python2.7/site-packages/nltk/tbl/erroranalysis.pyt
   error_list   s    
#
	!0N(   t
   __future__R    R   (    (    (    s5   lib/python2.7/site-packages/nltk/tbl/erroranalysis.pyt   <module>   s   