3
d                 @   s   d d Z dS )c          
   C   s  ddd  d dd  d dd  ddj dd	f }|g}xt| |D ]\}}xt|D ]\}\}}|| d
 }	||	krXdjdd |d| D }
djdd ||d
 d D }| d|	 d| }|j|
dd dd|j d d|dd   qXW qFW |S )a  
    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)
    z%25s | %s | %s
-   +   zleft contextzword/test->gold   zright context    c             s   s   | ]}d | V  qdS )z%s/%sN ).0wr   r   6/tmp/pip-build-v9q4h5k9/nltk/nltk/tbl/erroranalysis.py	<genexpr>!   s    zerror_list.<locals>.<genexpr>Nc             s   s   | ]}d | V  qdS )z%s/%sNr   )r	   r
   r   r   r   r   "   s    /z->   z>25z | i)centerzip	enumeratejoinappend)Ztrain_sentsZ
test_sentshdrerrorsZ
train_sentZ	test_sentZwordnumwordZ	train_posZtest_posleftrightZmidr   r   r   
error_list   s    
" :r   N)r   r   r   r   r   <module>   s    