o
    oi
                     @   sR   d dl Z dadaddefddZddefddZd	efd
dZdd	efddZdS )    NFpathc                 C      | a dS )za
    Sets cache directory for TN/ITN unittests. Default is None, e.g. no cache during tests.
    N)	CACHE_DIR)r    r   T/home/ubuntu/.local/lib/python3.10/site-packages/tests/nemo_text_processing/utils.pyset_cache_dir      r   run_audio_basedc                 C   r   )zt
    Sets audio-based test mode for TN/ITN unittests. Default is False, e.g. audio-based tests will be skipped.
    N)RUN_AUDIO_BASED_TESTS)r	   r   r   r   set_audio_based_tests   r   r   	file_namec                 C   s   g }t tjtjttjj |  d2}|D ]&}|dd}|d }	 t	|dkr1|d n|dd }|
||f qW d   |S 1 sJw   Y  |S )z3
    Prepares tests pairs for ITN and TN tests
    r
~r         N)openosr   dirnameabspath__file__sepstripsplitlenappend)r   
test_pairsfline
componentsspokenwrittenr   r   r   parse_test_case_file%   s   ( 	
r"   >data_text_normalization/en/test_cases_normalize_with_audio.txtc                 C   s   g }t tjtjttjj |  d1}d}g }|D ]"}|dr7|r.|||f g }|	 
dd}q||	  qW d   n1 sIw   Y  |||f |S )z7
    Prepares tests pairs for audio based TN tests
    r   Nr    )r   r   r   r   r   r   r   
startswithr   r   replace)r   r   r   r!   normalized_optionsr   r   r   r   get_test_cases_multiple=   s   (
r(   )N)F)r#   )	r   r   r
   strr   boolr   r"   r(   r   r   r   r   <module>   s   