a
    Kb                     @   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s2Zexpectedr(   Z	predicted r-   ;lib/python3.9/site-packages/nltk/test/unit/test_distance.pytest_with_transpositions	   s    oz)TestEditDistance.test_with_transpositionsN)
__name__
__module____qualname__pytestZmarkZparametrizestrintr   r/   r-   r-   r-   r.   r      s   ar   )typingr   r3   Znltk.metrics.distancer   r   r-   r-   r-   r.   <module>   s   