a
    ±Kbm  ã                   @   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$   g d¢}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assertAlmostEqualZalpha©ÚselfÚdataZannotation_task© r   ú?lib/python3.9/site-packages/nltk/test/unit/test_disagreement.pyÚ	test_easy   s    zTestDisagreement.test_easyc                 C   s$   g d¢}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   s$   g d¢}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   r"   r   )r   r"   r   )r   r"   r   )r   Ú6r   )r   r#   r   )r   r#   r    )r   r#   r!   )r   Ú7r!   )r   r$   r!   )r   r$   r!   )r   r$   r!   )r   Ú8r   )r   r%   r   )r   r%   r   )r   r%   r   )r   Ú9r   )r   r&   r   )r   r&   r   )r   r&   r   )r   Ú10r"   )r   r'   r"   )r   r'   r"   )r   Ú11r   )r   r(   r   )r   Z12r    çrË†òÊç?Nr   r   r   r   r   Útest_advanced,   s    +zTestDisagreement.test_advancedc                 C   s$   g d¢}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)   Nr   r   r   r   r   Útest_advanced2_   s    +zTestDisagreement.test_advanced2N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r*   r+   r   r   r   r   r      s
   3r   )ZunittestZnltk.metrics.agreementr   ZTestCaser   r   r   r   r   Ú<module>   s   