U
    e                     @   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dddddddd	d
ddddddddddddg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&t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   AssertionError)
selfr$   r%   r&   r'   s1s2expectedr(   Z	predicted r/   ]/var/www/html/assets/scripts/venv/lib/python3.8/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   r1   r/   r/   r/   r0   r      s<   			a   
r   )typingr   r5   Znltk.metrics.distancer   r   r/   r/   r/   r0   <module>   s   