U
    ƒem  ã                   @   s*   d dl Z d dlmZ G dd„ de jƒZdS )é    N)ÚAnnotationTaskc                   @   s0   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
S )ÚTestDisagreementzN
    Class containing unit tests for nltk.metrics.agreement.Disagreement.
    c                 C   s,   ddddddg}t |ƒ}|  | ¡ d¡ dS )	z}
        Simple test, based on
        https://github.com/foolswood/krippendorffs_alpha/raw/master/krippendorff.pdf.
        ©Úcoder1Údress1ÚYES©Úcoder2r   ÚNO©Úcoder3r   r
   ©r   Údress2r   ©r	   r   r
   )r   Zdress3r
   ç‡¼Š1UUÕ¿N©r   ZassertAlmostEqualÚalpha©ÚselfÚdataZannotation_task© r   úa/var/www/html/assets/scripts/venv/lib/python3.8/site-packages/nltk/test/unit/test_disagreement.pyÚ	test_easy   s    úzTestDisagreement.test_easyc                 C   s*   dddddg}t |ƒ}|  | ¡ d¡ dS )zœ
        Same simple test with 1 rating removed.
        Removal of that rating should not matter: K-Apha ignores items with
        only 1 rating.
        r   r   r   r   r   r   Nr   r   r   r   r   Ú
test_easy2   s    ûzTestDisagreement.test_easy2c              )   C   sr   ddddddddd	d
dddddddddddddddddddddd d!d"d#d$d%d&d'd(d)g)}t |ƒ}|  | ¡ d*¡ d+S ),zw
        More advanced test, based on
        http://www.agreestat.com/research_papers/onkrippendorffalpha.pdf
        ©ÚAÚ1r   ©ÚBr   r   ©ÚDr   r   ©r   Ú2r"   ©r   r"   r"   ©ÚCr"   Ú3©r    r"   r"   ©r   r&   r&   ©r   r&   r&   ©r%   r&   r&   ©r    r&   r&   ©r   Ú4r&   ©r   r-   r&   ©r%   r-   r&   ©r    r-   r&   ©r   Ú5r"   ©r   r2   r"   ©r%   r2   r"   ©r    r2   r"   ©r   Ú6r   ©r   r7   r"   ©r%   r7   r&   ©r    r7   r-   ©r   Ú7r-   ©r   r<   r-   ©r%   r<   r-   ©r    r<   r-   ©r   Ú8r   ©r   rA   r   ©r%   rA   r"   ©r    rA   r   ©r   Ú9r"   ©r   rF   r"   ©r%   rF   r"   ©r    rF   r"   ©r   Ú10r2   ©r%   rK   r2   ©r    rK   r2   ©r%   Ú11r   ©r    rO   r   ©r%   Z12r&   çrË†òÊç?Nr   r   r   r   r   Útest_advanced,   sX    ×+zTestDisagreement.test_advancedc              )   C   sr   ddddddddd	d
dddddddddddddddddddddd d!d"d#d$d%d&d'd(d)g)}t |ƒ}|  | ¡ d*¡ d+S ),zƒ
        Same more advanced example, but with 1 rating removed.
        Again, removal of that 1 rating should not matter.
        r   r   r   r!   r#   r$   r'   r(   r)   r*   r+   r,   r.   r/   r0   r1   r3   r4   r5   r6   r8   r9   r:   r;   r=   r>   r?   r@   rB   rC   rD   rE   rG   rH   rI   rJ   rL   rM   rN   rP   rQ   rR   Nr   r   r   r   r   Útest_advanced2_   sX    ×+zTestDisagreement.test_advanced2N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   rS   rT   r   r   r   r   r      s
   3r   )ZunittestZnltk.metrics.agreementr   ZTestCaser   r   r   r   r   Ú<module>   s   