o
    h                     @   s8   d dl Z dddZedkree jd e jd  dS dS )	    NTc           	      C   s  t |d}t | d}d}d}d}|D ]}| }|dr&t||d qt|dkr9t||d d}d}d}q|d}|rGd|d v rGq|d	7 }d
|d v rdd |d d
D \}}td|d|d	d |d dkrsdn|d d |d |d	8 }q||  kr|krn nqtd|d|d	d |d qW d   n1 sw   Y  W d   dS W d   dS 1 sw   Y  dS )z
    Simplify the gold tokenizer data for use as MWT processor test files

    The simplifications are to remove the expanded MWTs, and in the
    case of ignore_gapping=True, remove any copy words for the dependencies
    wrr   #)file	.   -c                 S   s   g | ]}t |qS  )int).0xr   r   ]/var/www/html/env_mimamsha/lib/python3.10/site-packages/stanza/utils/datasets/contract_mwt.py
<listcomp>$   s    z contract_mwt.<locals>.<listcomp>z{}	{}	{}_zMWT=Yesz|MWT=Yesz{}	{}N)openstrip
startswithprintlensplitformatjoin)	infileoutfileignore_gappingfoutfinidx	mwt_beginmwt_endliner   r   r   contract_mwt   s@   

<
$"r#   __main__r	      )T)sysr#   __name__argvr   r   r   r   <module>   s
    
)