o
    –hï  ã                   @   s   ddd„Z d S )Nc                 C   s@  d}t | ƒt |ƒd }}|du r,dd„ | D ƒg}|dd„ |D ƒ7 }dd„ t|Ž D ƒ}n|g| }|dt|ƒd  d	 7 }|d
7 }t| ƒD ]\}}	|dt|	ƒ || d ¡ d
 7 }qE|d	7 }|dt|ƒd  d	 7 }|D ]$}
|d
7 }t|
ƒD ]\}}	|dt|	ƒ || d ¡ d
 7 }qw|d	7 }qm|dt|ƒd  d	 7 }|S )a
  
    Input:
    header -> List[str]: table header
    content -> List[List[str]]: table content
    column_width -> int: table column width; set to None for dynamically calculated widths
    
    Output:
    table_str -> str: well-formatted string for the table
    Ú é   Nc                 S   ó   g | ]}t t|ƒƒ‘qS © ©ÚlenÚstr)Ú.0Úhr   r   úS/var/www/html/env_mimamsha/lib/python3.10/site-packages/stanza/utils/helper_func.pyÚ
<listcomp>   ó    zmake_table.<locals>.<listcomp>c                 S   s   g | ]	}d d„ |D ƒ‘qS )c                 S   r   r   r   )r   Úxr   r   r
   r      r   z)make_table.<locals>.<listcomp>.<listcomp>r   )r   Úrowr   r   r
   r      s    c                 S   s   g | ]}t |ƒd  ‘qS )é   )Úmax)r   Úcr   r   r
   r      r   ú=Ú
ú|ú é   ú-)r   ÚzipÚsumÚ	enumerater   Úljust)ÚheaderÚcontentÚcolumn_widthÚ	table_strÚ
len_columnÚlen_rowÚlensÚcolumn_widthsÚiÚitemÚliner   r   r
   Ú
make_table   s(   

$$
r'   )N)r'   r   r   r   r
   Ú<module>   s    