a
     ˜ëjN  ã                   @   s2   d dl mZ d dlZd dlmZ G dd„ dƒZdS )é    )ÚTupleN)Úedit_distancec                   @   s:   e Zd Zej dg d¢¡eeeeeef dœdd„ƒZ	dS )ÚTestEditDistancez&left,right,substitution_cost,expecteds))ÚabcÚcaé   ©é   é   )r   r   é   r   )ÚwantsÚwaspr   ©r
   r
   )r   r   r   r   )ÚrainÚshiner   r   )r   r   r	   ©r   r   )ÚacbdefÚabcdefr   ©r   r	   )r   r   r	   r   )ÚlnaguaegÚlanguager   ©r	   é   )r   r   r	   r   )Úlnaugager   r   r   )r   r   r	   r   )Úlngauager   r   ©r	   r	   )r   r   r	   r   )r   Úswimr   r   )r   r   r	   )é   é   )ÚkittenÚsittingr   r   )r   r    r	   r   )Ú
duplicatedÚduuplicatedr   ©r   r   )r!   r"   r	   r#   )zvery duplicatedzvery duuplicateedr	   r   )ÚleftÚrightÚsubstitution_costÚ	expectedsc           
      C   sR   ||f||ffD ]<\}}t |ddgƒD ]$\}}t||||d�}	|	|ks&J ‚q&qdS )a\  
        Test `edit_distance` between two strings, given some `substitution_cost`,
        and whether transpositions are allowed.

        :param str left: First input string to `edit_distance`.
        :param str right: Second input string to `edit_distance`.
        :param int substitution_cost: The cost of a substitution action in `edit_distance`.
        :param Tuple[int, int] expecteds: A tuple of expected outputs, such that `expecteds[0]` is
            the expected output with `transpositions=True`, and `expecteds[1]` is
            the expected output with `transpositions=False`.
        TF)r&   ÚtranspositionsN)Úzipr   )
Úselfr$   r%   r&   r'   Ús1Ús2Úexpectedr(   Z	predicted© r.   ú[/mnt/bigstor/www/usecases/.venv/lib/python3.9/site-packages/nltk/test/unit/test_distance.pyÚtest_with_transpositions	   s    oüz)TestEditDistance.test_with_transpositionsN)
Ú__name__Ú
__module__Ú__qualname__ÚpytestÚmarkZparametrizeÚstrÚintr   r0   r.   r.   r.   r/   r      s   þaÿr   )Útypingr   r4   Znltk.metrics.distancer   r   r.   r.   r.   r/   Ú<module>   s   